diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index e83f79f87d5..7c16e912b3c 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,7 +1,10 @@ { "ImportPath": "k8s.io/kubernetes", "GoVersion": "go1.6", + "GodepVersion": "v63", "Packages": [ + "github.com/ugorji/go/codec/codecgen", + "github.com/onsi/ginkgo/ginkgo", "./..." ], "Deps": [ @@ -52,6 +55,16 @@ "Comment": "v0.7.4-43-gd22f52b", "Rev": "d22f52bfeba06614d37c7aa1ad6fd76d8fdb2ba8" }, + { + "ImportPath": "github.com/appc/spec/schema/common", + "Comment": "v0.7.4-43-gd22f52b", + "Rev": "d22f52bfeba06614d37c7aa1ad6fd76d8fdb2ba8" + }, + { + "ImportPath": "github.com/appc/spec/schema/types", + "Comment": "v0.7.4-43-gd22f52b", + "Rev": "d22f52bfeba06614d37c7aa1ad6fd76d8fdb2ba8" + }, { "ImportPath": "github.com/armon/go-metrics", "Rev": "345426c77237ece5dab0e1605c3e4b35c3f54757" @@ -61,6 +74,61 @@ "Comment": "v1.0.7", "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/awserr", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/awsutil", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/client", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/client/metadata", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/corehandlers", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/credentials", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/defaults", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/ec2metadata", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/request", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, + { + "ImportPath": "github.com/aws/aws-sdk-go/aws/session", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, { "ImportPath": "github.com/aws/aws-sdk-go/private/endpoints", "Comment": "v1.0.7", @@ -86,6 +154,11 @@ "Comment": "v1.0.7", "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" }, + { + "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil", + "Comment": "v1.0.7", + "Rev": "bf2f8fe7f45e68017086d069498638893feddf64" + }, { "ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest", "Comment": "v1.0.7", @@ -142,7 +215,7 @@ }, { "ImportPath": "github.com/codegangsta/negroni", - "Comment": "v0.1-62-g8d75e11", + "Comment": "v0.1.0-62-g8d75e11", "Rev": "8d75e11374a1928608c906fe745b538483e7aeb2" }, { @@ -155,6 +228,11 @@ "Comment": "v2.3.0-282-g8b320e7", "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" }, + { + "ImportPath": "github.com/coreos/etcd/auth/authpb", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, { "ImportPath": "github.com/coreos/etcd/client", "Comment": "v2.3.0-282-g8b320e7", @@ -185,6 +263,51 @@ "Comment": "v2.3.0-282-g8b320e7", "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v2http", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v2http/httptypes", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3rpc", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/auth", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/etcdserverpb", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/membership", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/etcdserver/stats", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, { "ImportPath": "github.com/coreos/etcd/integration", "Comment": "v2.3.0-282-g8b320e7", @@ -195,6 +318,16 @@ "Comment": "v2.3.0-282-g8b320e7", "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" }, + { + "ImportPath": "github.com/coreos/etcd/lease/leasehttp", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/lease/leasepb", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, { "ImportPath": "github.com/coreos/etcd/pkg/adt", "Comment": "v2.3.0-282-g8b320e7", @@ -290,6 +423,11 @@ "Comment": "v2.3.0-282-g8b320e7", "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" }, + { + "ImportPath": "github.com/coreos/etcd/raft/raftpb", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, { "ImportPath": "github.com/coreos/etcd/rafthttp", "Comment": "v2.3.0-282-g8b320e7", @@ -300,11 +438,26 @@ "Comment": "v2.3.0-282-g8b320e7", "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" }, + { + "ImportPath": "github.com/coreos/etcd/snap/snappb", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, { "ImportPath": "github.com/coreos/etcd/storage", "Comment": "v2.3.0-282-g8b320e7", "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" }, + { + "ImportPath": "github.com/coreos/etcd/storage/backend", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, + { + "ImportPath": "github.com/coreos/etcd/storage/storagepb", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, { "ImportPath": "github.com/coreos/etcd/store", "Comment": "v2.3.0-282-g8b320e7", @@ -320,6 +473,11 @@ "Comment": "v2.3.0-282-g8b320e7", "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" }, + { + "ImportPath": "github.com/coreos/etcd/wal/walpb", + "Comment": "v2.3.0-282-g8b320e7", + "Rev": "8b320e7c550067b1dfb37bd1682e8067023e0751" + }, { "ImportPath": "github.com/coreos/go-etcd/etcd", "Comment": "v2.0.0-38-g003851b", @@ -443,6 +601,11 @@ "Comment": "v1.4.1-4831-g0f5c9d3", "Rev": "0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d" }, + { + "ImportPath": "github.com/docker/docker/pkg/term/winconsole", + "Comment": "v1.4.1-4831-g0f5c9d3", + "Rev": "0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d" + }, { "ImportPath": "github.com/docker/docker/pkg/timeutils", "Comment": "v1.4.1-4831-g0f5c9d3", @@ -458,11 +621,66 @@ "Comment": "v0.3.1-62-g3d72d39", "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" }, + { + "ImportPath": "github.com/docker/engine-api/client/transport", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, + { + "ImportPath": "github.com/docker/engine-api/client/transport/cancellable", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, { "ImportPath": "github.com/docker/engine-api/types", "Comment": "v0.3.1-62-g3d72d39", "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" }, + { + "ImportPath": "github.com/docker/engine-api/types/blkiodev", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, + { + "ImportPath": "github.com/docker/engine-api/types/container", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, + { + "ImportPath": "github.com/docker/engine-api/types/filters", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, + { + "ImportPath": "github.com/docker/engine-api/types/network", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, + { + "ImportPath": "github.com/docker/engine-api/types/reference", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, + { + "ImportPath": "github.com/docker/engine-api/types/registry", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, + { + "ImportPath": "github.com/docker/engine-api/types/strslice", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, + { + "ImportPath": "github.com/docker/engine-api/types/time", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, + { + "ImportPath": "github.com/docker/engine-api/types/versions", + "Comment": "v0.3.1-62-g3d72d39", + "Rev": "3d72d392d07bece8d7d7b2a3b6b2e57c2df376a2" + }, { "ImportPath": "github.com/docker/go-connections/nat", "Comment": "v0.2.0-2-gf549a93", @@ -487,6 +705,10 @@ "ImportPath": "github.com/docker/spdystream", "Rev": "449fdfce4d962303d702fec724ef0ad181c92528" }, + { + "ImportPath": "github.com/docker/spdystream/spdy", + "Rev": "449fdfce4d962303d702fec724ef0ad181c92528" + }, { "ImportPath": "github.com/elazarl/go-bindata-assetfs", "Rev": "3dcc96556217539f50599357fb481ac0dc7439b9" @@ -501,6 +723,16 @@ "Comment": "v1.2-34-g496d495", "Rev": "496d495156da218b9912f03dfa7df7f80fbd8cc3" }, + { + "ImportPath": "github.com/emicklei/go-restful/log", + "Comment": "v1.2-34-g496d495", + "Rev": "496d495156da218b9912f03dfa7df7f80fbd8cc3" + }, + { + "ImportPath": "github.com/emicklei/go-restful/swagger", + "Comment": "v1.2-34-g496d495", + "Rev": "496d495156da218b9912f03dfa7df7f80fbd8cc3" + }, { "ImportPath": "github.com/evanphx/json-patch", "Rev": "7dd4489c2eb6073e5a9d7746c3274c5b5f0387df" @@ -509,6 +741,74 @@ "ImportPath": "github.com/fsouza/go-dockerclient", "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/fileutils", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/longpath", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/pools", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/promise", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/stdcopy", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/docker/go-units", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/golang.org/x/net/context", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, + { + "ImportPath": "github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix", + "Rev": "bf97c77db7c945cbcdbf09d56c6f87a66f54537b" + }, { "ImportPath": "github.com/garyburd/redigo/internal", "Rev": "535138d7bcd717d6531c701ef5933d98b1866257" @@ -646,6 +946,11 @@ "Comment": "v0.1-125-g82d16f7", "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" }, + { + "ImportPath": "github.com/gogo/protobuf/vanity/command", + "Comment": "v0.1-125-g82d16f7", + "Rev": "82d16f734d6d871204a3feb1a73cb220cc92574c" + }, { "ImportPath": "github.com/golang/glog", "Rev": "44145f04b68cf362d9c4df2182967c2275eaefed" @@ -686,6 +991,36 @@ "Comment": "v0.23.0", "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" }, + { + "ImportPath": "github.com/google/cadvisor/container/common", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/container/docker", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/container/libcontainer", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/container/raw", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/container/rkt", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/container/systemd", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, { "ImportPath": "github.com/google/cadvisor/events", "Comment": "v0.23.0", @@ -706,11 +1041,21 @@ "Comment": "v0.23.0", "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" }, + { + "ImportPath": "github.com/google/cadvisor/http/mux", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, { "ImportPath": "github.com/google/cadvisor/info/v1", "Comment": "v0.23.0", "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" }, + { + "ImportPath": "github.com/google/cadvisor/info/v1/test", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, { "ImportPath": "github.com/google/cadvisor/info/v2", "Comment": "v0.23.0", @@ -731,6 +1076,11 @@ "Comment": "v0.23.0", "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" }, + { + "ImportPath": "github.com/google/cadvisor/pages/static", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, { "ImportPath": "github.com/google/cadvisor/storage", "Comment": "v0.23.0", @@ -746,6 +1096,41 @@ "Comment": "v0.23.0", "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" }, + { + "ImportPath": "github.com/google/cadvisor/utils/cloudinfo", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/utils/cpuload", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/utils/cpuload/netlink", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/utils/machine", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/utils/oomparser", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/utils/sysfs", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, + { + "ImportPath": "github.com/google/cadvisor/utils/sysinfo", + "Comment": "v0.23.0", + "Rev": "750f18e5eac3f6193b354fc14c03d92d4318a0ec" + }, { "ImportPath": "github.com/google/cadvisor/validate", "Comment": "v0.23.0", @@ -776,6 +1161,10 @@ "ImportPath": "github.com/hashicorp/golang-lru", "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" }, + { + "ImportPath": "github.com/hashicorp/golang-lru/simplelru", + "Rev": "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" + }, { "ImportPath": "github.com/hashicorp/raft", "Rev": "057b893fd996696719e98b6c44649ea14968c811" @@ -813,6 +1202,11 @@ "Comment": "v0.9.2.1", "Rev": "b237c68bab4756507baf6840023be103853e77db" }, + { + "ImportPath": "github.com/influxdb/influxdb/meta/internal", + "Comment": "v0.9.2.1", + "Rev": "b237c68bab4756507baf6840023be103853e77db" + }, { "ImportPath": "github.com/influxdb/influxdb/snapshot", "Comment": "v0.9.2.1", @@ -828,6 +1222,11 @@ "Comment": "v0.9.2.1", "Rev": "b237c68bab4756507baf6840023be103853e77db" }, + { + "ImportPath": "github.com/influxdb/influxdb/tsdb/internal", + "Comment": "v0.9.2.1", + "Rev": "b237c68bab4756507baf6840023be103853e77db" + }, { "ImportPath": "github.com/jmespath/go-jmespath", "Comment": "0.2.2", @@ -859,11 +1258,36 @@ "Comment": "before-0.26-protos-33-g45c8b08", "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" }, + { + "ImportPath": "github.com/mesos/mesos-go/auth/callback", + "Comment": "before-0.26-protos-33-g45c8b08", + "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" + }, + { + "ImportPath": "github.com/mesos/mesos-go/auth/sasl", + "Comment": "before-0.26-protos-33-g45c8b08", + "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" + }, + { + "ImportPath": "github.com/mesos/mesos-go/auth/sasl/mech", + "Comment": "before-0.26-protos-33-g45c8b08", + "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" + }, + { + "ImportPath": "github.com/mesos/mesos-go/auth/sasl/mech/crammd5", + "Comment": "before-0.26-protos-33-g45c8b08", + "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" + }, { "ImportPath": "github.com/mesos/mesos-go/detector", "Comment": "before-0.26-protos-33-g45c8b08", "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" }, + { + "ImportPath": "github.com/mesos/mesos-go/detector/zoo", + "Comment": "before-0.26-protos-33-g45c8b08", + "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" + }, { "ImportPath": "github.com/mesos/mesos-go/executor", "Comment": "before-0.26-protos-33-g45c8b08", @@ -874,16 +1298,31 @@ "Comment": "before-0.26-protos-33-g45c8b08", "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" }, + { + "ImportPath": "github.com/mesos/mesos-go/mesosproto/scheduler", + "Comment": "before-0.26-protos-33-g45c8b08", + "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" + }, { "ImportPath": "github.com/mesos/mesos-go/mesosutil", "Comment": "before-0.26-protos-33-g45c8b08", "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" }, + { + "ImportPath": "github.com/mesos/mesos-go/mesosutil/process", + "Comment": "before-0.26-protos-33-g45c8b08", + "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" + }, { "ImportPath": "github.com/mesos/mesos-go/messenger", "Comment": "before-0.26-protos-33-g45c8b08", "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" }, + { + "ImportPath": "github.com/mesos/mesos-go/messenger/sessionid", + "Comment": "before-0.26-protos-33-g45c8b08", + "Rev": "45c8b08e9af666add36a6f93ff8c1c75812367b0" + }, { "ImportPath": "github.com/mesos/mesos-go/scheduler", "Comment": "before-0.26-protos-33-g45c8b08", @@ -921,16 +1360,246 @@ "Comment": "v1.2.0-52-g2c2e9bb", "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" }, + { + "ImportPath": "github.com/onsi/ginkgo/config", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/ginkgo", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/ginkgo/convert", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/ginkgo/interrupthandler", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/ginkgo/nodot", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/ginkgo/testrunner", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/ginkgo/testsuite", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/ginkgo/watch", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/codelocation", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/containernode", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/failer", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/leafnodes", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/remote", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/spec", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/specrunner", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/suite", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/testingtproxy", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/internal/writer", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/reporters", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/reporters/stenographer", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, + { + "ImportPath": "github.com/onsi/ginkgo/types", + "Comment": "v1.2.0-52-g2c2e9bb", + "Rev": "2c2e9bb47b4e44067024f29339588cac8b34dd12" + }, { "ImportPath": "github.com/onsi/gomega", "Comment": "v1.0-91-g7ce781e", "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" }, + { + "ImportPath": "github.com/onsi/gomega/format", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/internal/assertion", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/internal/asyncassertion", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/internal/oraclematcher", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/internal/testingtsupport", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/matchers", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/matchers/support/goraph/bipartitegraph", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/matchers/support/goraph/edge", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/matchers/support/goraph/node", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/matchers/support/goraph/util", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, + { + "ImportPath": "github.com/onsi/gomega/types", + "Comment": "v1.0-91-g7ce781e", + "Rev": "7ce781ea776b2fd506491011353bded2e40c8467" + }, { "ImportPath": "github.com/opencontainers/runc/libcontainer", "Comment": "v0.0.7", "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/apparmor", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups/fs", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups/systemd", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/configs", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/configs/validate", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/criurpc", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/label", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/seccomp", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/selinux", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/stacktrace", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/system", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/user", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, + { + "ImportPath": "github.com/opencontainers/runc/libcontainer/utils", + "Comment": "v0.0.7", + "Rev": "7ca2aa4873aea7cb4265b1726acb24b90d8726c6" + }, { "ImportPath": "github.com/pborman/uuid", "Rev": "ca53cad383cad2479bbba7f7a1a05797ec1386e4" @@ -966,6 +1635,131 @@ "Comment": "v1.0.0-842-g8992d74", "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/blockstorage/v1/volumes", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/bootfromvolume", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/diskconfig", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/flavors", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/images", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/compute/v2/servers", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/identity/v2/tenants", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/identity/v2/tokens", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/identity/v3/tokens", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/floatingips", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/members", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/monitors", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/pools", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/networking/v2/extensions/lbaas/vips", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/openstack/utils", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/pagination", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/rackspace", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumes", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/rackspace/compute/v2/servers", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/rackspace/compute/v2/volumeattach", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/rackspace/identity/v2/tokens", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/testhelper", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, + { + "ImportPath": "github.com/rackspace/gophercloud/testhelper/client", + "Comment": "v1.0.0-842-g8992d74", + "Rev": "8992d7483a06748dea706e4716d042a4a9e73918" + }, { "ImportPath": "github.com/russross/blackfriday", "Comment": "v1.2-42-g77efab5", @@ -992,6 +1786,10 @@ "ImportPath": "github.com/spf13/cobra", "Rev": "4c05eb1145f16d0e6bb4a3e1b6d769f4713cb41f" }, + { + "ImportPath": "github.com/spf13/cobra/doc", + "Rev": "4c05eb1145f16d0e6bb4a3e1b6d769f4713cb41f" + }, { "ImportPath": "github.com/spf13/pflag", "Rev": "08b1a584251b5b62f458943640fc8ebd4d50aaa5" @@ -1023,15 +1821,93 @@ "ImportPath": "github.com/ugorji/go/codec", "Rev": "f4485b318aadd133842532f841dc205a8e339d74" }, + { + "ImportPath": "github.com/ugorji/go/codec/codecgen", + "Rev": "f4485b318aadd133842532f841dc205a8e339d74" + }, { "ImportPath": "github.com/vishvananda/netlink", "Rev": "1e2e08e8a2dcdacaae3f14ac44c5cfa31361f270" }, + { + "ImportPath": "github.com/vishvananda/netlink/nl", + "Rev": "1e2e08e8a2dcdacaae3f14ac44c5cfa31361f270" + }, { "ImportPath": "github.com/vmware/govmomi", "Comment": "v0.5.0", "Rev": "c1b29993f383c32fc3fadb90892909668699810a" }, + { + "ImportPath": "github.com/vmware/govmomi/find", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/list", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/object", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/property", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/session", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/task", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/debug", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/methods", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/mo", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/progress", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/soap", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/types", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, + { + "ImportPath": "github.com/vmware/govmomi/vim25/xml", + "Comment": "v0.5.0", + "Rev": "c1b29993f383c32fc3fadb90892909668699810a" + }, { "ImportPath": "github.com/xiang90/probing", "Rev": "6a0cc1ae81b4cc11db5e491e030e4b98fba79c19" @@ -1065,14 +1941,26 @@ "ImportPath": "golang.org/x/net/context", "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" }, + { + "ImportPath": "golang.org/x/net/context/ctxhttp", + "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" + }, { "ImportPath": "golang.org/x/net/html", "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" }, + { + "ImportPath": "golang.org/x/net/html/atom", + "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" + }, { "ImportPath": "golang.org/x/net/http2", "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" }, + { + "ImportPath": "golang.org/x/net/http2/hpack", + "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" + }, { "ImportPath": "golang.org/x/net/internal/timeseries", "Rev": "c2528b2dd8352441850638a8bb678c2ad056fd3e" @@ -1093,6 +1981,22 @@ "ImportPath": "golang.org/x/oauth2", "Rev": "b5adcc2dcdf009d0391547edc6ecbaff889f5bb9" }, + { + "ImportPath": "golang.org/x/oauth2/google", + "Rev": "b5adcc2dcdf009d0391547edc6ecbaff889f5bb9" + }, + { + "ImportPath": "golang.org/x/oauth2/internal", + "Rev": "b5adcc2dcdf009d0391547edc6ecbaff889f5bb9" + }, + { + "ImportPath": "golang.org/x/oauth2/jws", + "Rev": "b5adcc2dcdf009d0391547edc6ecbaff889f5bb9" + }, + { + "ImportPath": "golang.org/x/oauth2/jwt", + "Rev": "b5adcc2dcdf009d0391547edc6ecbaff889f5bb9" + }, { "ImportPath": "golang.org/x/sys/unix", "Rev": "833a04a10549a95dc34458c195cbad61bbb6cb4d" @@ -1117,6 +2021,10 @@ "ImportPath": "google.golang.org/api/googleapi", "Rev": "77e7d383beb96054547729f49c372b3d01e196ff" }, + { + "ImportPath": "google.golang.org/api/googleapi/internal/uritemplates", + "Rev": "77e7d383beb96054547729f49c372b3d01e196ff" + }, { "ImportPath": "google.golang.org/cloud/compute/metadata", "Rev": "eb47ba841d53d93506cfbfbc03927daf9cc48f88" @@ -1129,10 +2037,54 @@ "ImportPath": "google.golang.org/grpc", "Rev": "933601d8cd6418a8a891bd9075a7161b0a67badb" }, + { + "ImportPath": "google.golang.org/grpc/codes", + "Rev": "933601d8cd6418a8a891bd9075a7161b0a67badb" + }, + { + "ImportPath": "google.golang.org/grpc/credentials", + "Rev": "933601d8cd6418a8a891bd9075a7161b0a67badb" + }, + { + "ImportPath": "google.golang.org/grpc/grpclog", + "Rev": "933601d8cd6418a8a891bd9075a7161b0a67badb" + }, + { + "ImportPath": "google.golang.org/grpc/metadata", + "Rev": "933601d8cd6418a8a891bd9075a7161b0a67badb" + }, + { + "ImportPath": "google.golang.org/grpc/naming", + "Rev": "933601d8cd6418a8a891bd9075a7161b0a67badb" + }, + { + "ImportPath": "google.golang.org/grpc/peer", + "Rev": "933601d8cd6418a8a891bd9075a7161b0a67badb" + }, + { + "ImportPath": "google.golang.org/grpc/transport", + "Rev": "933601d8cd6418a8a891bd9075a7161b0a67badb" + }, { "ImportPath": "gopkg.in/gcfg.v1", "Rev": "083575c3955c85df16fe9590cceab64d03f5eb6e" }, + { + "ImportPath": "gopkg.in/gcfg.v1/scanner", + "Rev": "083575c3955c85df16fe9590cceab64d03f5eb6e" + }, + { + "ImportPath": "gopkg.in/gcfg.v1/token", + "Rev": "083575c3955c85df16fe9590cceab64d03f5eb6e" + }, + { + "ImportPath": "gopkg.in/gcfg.v1/types", + "Rev": "083575c3955c85df16fe9590cceab64d03f5eb6e" + }, + { + "ImportPath": "gopkg.in/inf.v0", + "Rev": "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" + }, { "ImportPath": "gopkg.in/natefinch/lumberjack.v2", "Comment": "v1.0-16-g20b71e5", diff --git a/vendor/bitbucket.org/bertimus9/systemstat/examples/go-top.go b/vendor/bitbucket.org/bertimus9/systemstat/examples/go-top.go deleted file mode 100644 index 710281f2f5e..00000000000 --- a/vendor/bitbucket.org/bertimus9/systemstat/examples/go-top.go +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) 2013 Phillip Bond -// Licensed under the MIT License -// see file LICENSE - -package main - -// go-top -// -// A sample program that emulates the way gnu top gets most of its -// information. It does not get information about other processes, just the -// calling process. -// -// To demonstrate how the output changes, you can invoke with the -// -coresToPeg=N option. For example: -// -// go run go-top.go -coresToPeg=2 -// -// will run two concurrent infinte loops and max out up to two cores (assuming -// you have more than one core). Note that the loops are not tuned to always -// hit 100% on all machines, but they get close. Also note that each core you -// want to max out will add up to 100% CPU usage to this process, but you will -// get less than 100% per core if there are other processes using the CPU, or -// if the kernel is suffering high load averages, etc. -// -// %CCPU measures cumulative CPU usage. It is useful when you have a daemon -// that only runs periodically, but does intense calculations. You can use -// long sample times, on the order of minutes, but still get an accurate -// measure of how much CPU time has been used over the life of the process, -// even if your samples occur when the CPU is temporarily idle. - -import ( - "bitbucket.org/bertimus9/systemstat" - "bytes" - "encoding/json" - "flag" - "fmt" - "math" - "runtime" - "time" -) - -var coresToPegPtr *int64 - -type stats struct { - startTime time.Time - - // stats this process - ProcUptime float64 //seconds - ProcMemUsedPct float64 - ProcCPUAvg systemstat.ProcCPUAverage - LastProcCPUSample systemstat.ProcCPUSample `json:"-"` - CurProcCPUSample systemstat.ProcCPUSample `json:"-"` - - // stats for whole system - LastCPUSample systemstat.CPUSample `json:"-"` - CurCPUSample systemstat.CPUSample `json:"-"` - SysCPUAvg systemstat.CPUAverage - SysMemK systemstat.MemSample - LoadAverage systemstat.LoadAvgSample - SysUptime systemstat.UptimeSample - - // bookkeeping - procCPUSampled bool - sysCPUSampled bool -} - -func NewStats() *stats { - s := stats{} - s.startTime = time.Now() - return &s -} - -func (s *stats) PrintStats() { - up, err := time.ParseDuration(fmt.Sprintf("%fs", s.SysUptime.Uptime)) - upstring := "SysUptime Error" - if err == nil { - updays := up.Hours() / 24 - switch { - case updays >= 365: - upstring = fmt.Sprintf("%.0f years", updays/365) - case updays >= 1: - upstring = fmt.Sprintf("%.0f days", updays) - default: // less than a day - upstring = up.String() - } - } - - fmt.Println("*********************************************************") - fmt.Printf("go-top - %s up %s,\t\tload average: %.2f, %.2f, %.2f\n", - s.LoadAverage.Time.Format("15:04:05"), upstring, s.LoadAverage.One, s.LoadAverage.Five, s.LoadAverage.Fifteen) - - fmt.Printf("Cpu(s): %.1f%%us, %.1f%%sy, %.1f%%ni, %.1f%%id, %.1f%%wa, %.1f%%hi, %.1f%%si, %.1f%%st %.1f%%gu\n", - s.SysCPUAvg.UserPct, s.SysCPUAvg.SystemPct, s.SysCPUAvg.NicePct, s.SysCPUAvg.IdlePct, - s.SysCPUAvg.IowaitPct, s.SysCPUAvg.IrqPct, s.SysCPUAvg.SoftIrqPct, s.SysCPUAvg.StealPct, - s.SysCPUAvg.GuestPct) - - fmt.Printf("Mem: %9dk total, %9dk used, %9dk free, %9dk buffers\n", s.SysMemK.MemTotal, - s.SysMemK.MemUsed, s.SysMemK.MemFree, s.SysMemK.Buffers) - fmt.Printf("Swap: %9dk total, %9dk used, %9dk free, %9dk cached\n", s.SysMemK.SwapTotal, - s.SysMemK.SwapUsed, s.SysMemK.SwapFree, s.SysMemK.Cached) - - fmt.Println("************************************************************") - if s.ProcCPUAvg.PossiblePct > 0 { - cpuHelpText := "[see -help flag to change %cpu]" - if *coresToPegPtr > 0 { - cpuHelpText = "" - } - fmt.Printf("ProcessName\tRES(k)\t%%CPU\t%%CCPU\t%%MEM\n") - fmt.Printf("this-process\t%d\t%3.1f\t%2.1f\t%3.1f\t%s\n", - s.CurProcCPUSample.ProcMemUsedK, - s.ProcCPUAvg.TotalPct, - 100*s.CurProcCPUSample.Total/s.ProcUptime/float64(1), - 100*float64(s.CurProcCPUSample.ProcMemUsedK)/float64(s.SysMemK.MemTotal), - cpuHelpText) - fmt.Println("%CCPU is cumulative CPU usage over this process' life.") - fmt.Printf("Max this-process CPU possible: %3.f%%\n", s.ProcCPUAvg.PossiblePct) - } -} - -func (s *stats) GatherStats(percent bool) { - s.SysUptime = systemstat.GetUptime() - s.ProcUptime = time.Since(s.startTime).Seconds() - - s.SysMemK = systemstat.GetMemSample() - s.LoadAverage = systemstat.GetLoadAvgSample() - - s.LastCPUSample = s.CurCPUSample - s.CurCPUSample = systemstat.GetCPUSample() - - if s.sysCPUSampled { // we need 2 samples to get an average - s.SysCPUAvg = systemstat.GetCPUAverage(s.LastCPUSample, s.CurCPUSample) - } - // we have at least one sample, subsequent rounds will give us an average - s.sysCPUSampled = true - - s.ProcMemUsedPct = 100 * float64(s.CurProcCPUSample.ProcMemUsedK) / float64(s.SysMemK.MemTotal) - - s.LastProcCPUSample = s.CurProcCPUSample - s.CurProcCPUSample = systemstat.GetProcCPUSample() - if s.procCPUSampled { - s.ProcCPUAvg = systemstat.GetProcCPUAverage(s.LastProcCPUSample, s.CurProcCPUSample, s.ProcUptime) - } - s.procCPUSampled = true -} - -func main() { - // get command line flags - coresToPegPtr = flag.Int64("coresToPeg", 0, "how many CPU cores would you like to artificially peg to 100% usage") - - flag.Parse() - - // this will help us poll the OS to get system statistics - stats := NewStats() - - runtime.GOMAXPROCS(runtime.NumCPU()) - - // WARNING: each call to burnCPU() will peg one core - // of your machine to 100% - // If you have code you'd like to drop in to this example, - // just run "go yourCode()" instead of "go burnCPU() - for i := *coresToPegPtr; i > 0; i-- { - fmt.Println("pegging one more CPU core.") - go burnCPU() - } - - for { - stats.GatherStats(true) - stats.PrintStats() - - // This next line lets out see the jsonified object - // produced by systemstat - // printJson(stats, false) - time.Sleep(3 * time.Second) - } -} - -func printJson(s *stats, indent bool) { - b, err := json.Marshal(s) - if err != nil { - fmt.Println("error:", err) - } - dst := new(bytes.Buffer) - if indent { - json.Indent(dst, b, "", " ") - } else { - dst.Write(b) - } - fmt.Println(dst.String()) - time.Sleep(time.Second * 3) -} - -func burnCPU() { - time.Sleep(4 * time.Second) - for { - b := 1.0 - c := 1.0 - d := 1.0 - for j := 1; j < 1000; j++ { - b *= float64(j) - for k := 1; k < 700000; k++ { - - c *= float64(k) - d = (28 + b*b/3.23412) / math.Sqrt(c*c) - c *= d - } - time.Sleep(500 * time.Nanosecond) - runtime.Gosched() - } - time.Sleep(10 * time.Second) - } -} diff --git a/vendor/github.com/Microsoft/go-winio/archive/tar/LICENSE b/vendor/github.com/Microsoft/go-winio/archive/tar/LICENSE deleted file mode 100644 index 74487567632..00000000000 --- a/vendor/github.com/Microsoft/go-winio/archive/tar/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/Microsoft/go-winio/archive/tar/common.go b/vendor/github.com/Microsoft/go-winio/archive/tar/common.go deleted file mode 100644 index 5141bf92d6d..00000000000 --- a/vendor/github.com/Microsoft/go-winio/archive/tar/common.go +++ /dev/null @@ -1,342 +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 tar implements access to tar archives. -// It aims to cover most of the variations, including those produced -// by GNU and BSD tars. -// -// References: -// http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5 -// http://www.gnu.org/software/tar/manual/html_node/Standard.html -// http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html -package tar - -import ( - "bytes" - "errors" - "fmt" - "os" - "path" - "time" -) - -const ( - blockSize = 512 - - // Types - TypeReg = '0' // regular file - TypeRegA = '\x00' // regular file - TypeLink = '1' // hard link - TypeSymlink = '2' // symbolic link - TypeChar = '3' // character device node - TypeBlock = '4' // block device node - TypeDir = '5' // directory - TypeFifo = '6' // fifo node - TypeCont = '7' // reserved - TypeXHeader = 'x' // extended header - TypeXGlobalHeader = 'g' // global extended header - TypeGNULongName = 'L' // Next file has a long name - TypeGNULongLink = 'K' // Next file symlinks to a file w/ a long name - TypeGNUSparse = 'S' // sparse file -) - -// A Header represents a single header in a tar archive. -// Some fields may not be populated. -type Header struct { - Name string // name of header file entry - Mode int64 // permission and mode bits - Uid int // user id of owner - Gid int // group id of owner - Size int64 // length in bytes - ModTime time.Time // modified time - Typeflag byte // type of header entry - Linkname string // target name of link - Uname string // user name of owner - Gname string // group name of owner - Devmajor int64 // major number of character or block device - Devminor int64 // minor number of character or block device - AccessTime time.Time // access time - ChangeTime time.Time // status change time - Xattrs map[string]string - Winheaders map[string]string -} - -// File name constants from the tar spec. -const ( - fileNameSize = 100 // Maximum number of bytes in a standard tar name. - fileNamePrefixSize = 155 // Maximum number of ustar extension bytes. -) - -// FileInfo returns an os.FileInfo for the Header. -func (h *Header) FileInfo() os.FileInfo { - return headerFileInfo{h} -} - -// headerFileInfo implements os.FileInfo. -type headerFileInfo struct { - h *Header -} - -func (fi headerFileInfo) Size() int64 { return fi.h.Size } -func (fi headerFileInfo) IsDir() bool { return fi.Mode().IsDir() } -func (fi headerFileInfo) ModTime() time.Time { return fi.h.ModTime } -func (fi headerFileInfo) Sys() interface{} { return fi.h } - -// Name returns the base name of the file. -func (fi headerFileInfo) Name() string { - if fi.IsDir() { - return path.Base(path.Clean(fi.h.Name)) - } - return path.Base(fi.h.Name) -} - -// Mode returns the permission and mode bits for the headerFileInfo. -func (fi headerFileInfo) Mode() (mode os.FileMode) { - // Set file permission bits. - mode = os.FileMode(fi.h.Mode).Perm() - - // Set setuid, setgid and sticky bits. - if fi.h.Mode&c_ISUID != 0 { - // setuid - mode |= os.ModeSetuid - } - if fi.h.Mode&c_ISGID != 0 { - // setgid - mode |= os.ModeSetgid - } - if fi.h.Mode&c_ISVTX != 0 { - // sticky - mode |= os.ModeSticky - } - - // Set file mode bits. - // clear perm, setuid, setgid and sticky bits. - m := os.FileMode(fi.h.Mode) &^ 07777 - if m == c_ISDIR { - // directory - mode |= os.ModeDir - } - if m == c_ISFIFO { - // named pipe (FIFO) - mode |= os.ModeNamedPipe - } - if m == c_ISLNK { - // symbolic link - mode |= os.ModeSymlink - } - if m == c_ISBLK { - // device file - mode |= os.ModeDevice - } - if m == c_ISCHR { - // Unix character device - mode |= os.ModeDevice - mode |= os.ModeCharDevice - } - if m == c_ISSOCK { - // Unix domain socket - mode |= os.ModeSocket - } - - switch fi.h.Typeflag { - case TypeSymlink: - // symbolic link - mode |= os.ModeSymlink - case TypeChar: - // character device node - mode |= os.ModeDevice - mode |= os.ModeCharDevice - case TypeBlock: - // block device node - mode |= os.ModeDevice - case TypeDir: - // directory - mode |= os.ModeDir - case TypeFifo: - // fifo node - mode |= os.ModeNamedPipe - } - - return mode -} - -// sysStat, if non-nil, populates h from system-dependent fields of fi. -var sysStat func(fi os.FileInfo, h *Header) error - -// Mode constants from the tar spec. -const ( - c_ISUID = 04000 // Set uid - c_ISGID = 02000 // Set gid - c_ISVTX = 01000 // Save text (sticky bit) - c_ISDIR = 040000 // Directory - c_ISFIFO = 010000 // FIFO - c_ISREG = 0100000 // Regular file - c_ISLNK = 0120000 // Symbolic link - c_ISBLK = 060000 // Block special file - c_ISCHR = 020000 // Character special file - c_ISSOCK = 0140000 // Socket -) - -// Keywords for the PAX Extended Header -const ( - paxAtime = "atime" - paxCharset = "charset" - paxComment = "comment" - paxCtime = "ctime" // please note that ctime is not a valid pax header. - paxGid = "gid" - paxGname = "gname" - paxLinkpath = "linkpath" - paxMtime = "mtime" - paxPath = "path" - paxSize = "size" - paxUid = "uid" - paxUname = "uname" - paxXattr = "SCHILY.xattr." - paxWindows = "MSWINDOWS." - paxNone = "" -) - -// FileInfoHeader creates a partially-populated Header from fi. -// If fi describes a symlink, FileInfoHeader records link as the link target. -// If fi describes a directory, a slash is appended to the name. -// Because os.FileInfo's Name method returns only the base name of -// the file it describes, it may be necessary to modify the Name field -// of the returned header to provide the full path name of the file. -func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) { - if fi == nil { - return nil, errors.New("tar: FileInfo is nil") - } - fm := fi.Mode() - h := &Header{ - Name: fi.Name(), - ModTime: fi.ModTime(), - Mode: int64(fm.Perm()), // or'd with c_IS* constants later - } - switch { - case fm.IsRegular(): - h.Mode |= c_ISREG - h.Typeflag = TypeReg - h.Size = fi.Size() - case fi.IsDir(): - h.Typeflag = TypeDir - h.Mode |= c_ISDIR - h.Name += "/" - case fm&os.ModeSymlink != 0: - h.Typeflag = TypeSymlink - h.Mode |= c_ISLNK - h.Linkname = link - case fm&os.ModeDevice != 0: - if fm&os.ModeCharDevice != 0 { - h.Mode |= c_ISCHR - h.Typeflag = TypeChar - } else { - h.Mode |= c_ISBLK - h.Typeflag = TypeBlock - } - case fm&os.ModeNamedPipe != 0: - h.Typeflag = TypeFifo - h.Mode |= c_ISFIFO - case fm&os.ModeSocket != 0: - h.Mode |= c_ISSOCK - default: - return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm) - } - if fm&os.ModeSetuid != 0 { - h.Mode |= c_ISUID - } - if fm&os.ModeSetgid != 0 { - h.Mode |= c_ISGID - } - if fm&os.ModeSticky != 0 { - h.Mode |= c_ISVTX - } - // If possible, populate additional fields from OS-specific - // FileInfo fields. - if sys, ok := fi.Sys().(*Header); ok { - // This FileInfo came from a Header (not the OS). Use the - // original Header to populate all remaining fields. - h.Uid = sys.Uid - h.Gid = sys.Gid - h.Uname = sys.Uname - h.Gname = sys.Gname - h.AccessTime = sys.AccessTime - h.ChangeTime = sys.ChangeTime - if sys.Xattrs != nil { - h.Xattrs = make(map[string]string) - for k, v := range sys.Xattrs { - h.Xattrs[k] = v - } - } - if sys.Typeflag == TypeLink { - // hard link - h.Typeflag = TypeLink - h.Size = 0 - h.Linkname = sys.Linkname - } - } - if sysStat != nil { - return h, sysStat(fi, h) - } - return h, nil -} - -var zeroBlock = make([]byte, blockSize) - -// POSIX specifies a sum of the unsigned byte values, but the Sun tar uses signed byte values. -// We compute and return both. -func checksum(header []byte) (unsigned int64, signed int64) { - for i := 0; i < len(header); i++ { - if i == 148 { - // The chksum field (header[148:156]) is special: it should be treated as space bytes. - unsigned += ' ' * 8 - signed += ' ' * 8 - i += 7 - continue - } - unsigned += int64(header[i]) - signed += int64(int8(header[i])) - } - return -} - -type slicer []byte - -func (sp *slicer) next(n int) (b []byte) { - s := *sp - b, *sp = s[0:n], s[n:] - return -} - -func isASCII(s string) bool { - for _, c := range s { - if c >= 0x80 { - return false - } - } - return true -} - -func toASCII(s string) string { - if isASCII(s) { - return s - } - var buf bytes.Buffer - for _, c := range s { - if c < 0x80 { - buf.WriteByte(byte(c)) - } - } - return buf.String() -} - -// isHeaderOnlyType checks if the given type flag is of the type that has no -// data section even if a size is specified. -func isHeaderOnlyType(flag byte) bool { - switch flag { - case TypeLink, TypeSymlink, TypeChar, TypeBlock, TypeDir, TypeFifo: - return true - default: - return false - } -} diff --git a/vendor/github.com/Microsoft/go-winio/archive/tar/reader.go b/vendor/github.com/Microsoft/go-winio/archive/tar/reader.go deleted file mode 100644 index 6aee36c1923..00000000000 --- a/vendor/github.com/Microsoft/go-winio/archive/tar/reader.go +++ /dev/null @@ -1,996 +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 tar - -// TODO(dsymonds): -// - pax extensions - -import ( - "bytes" - "errors" - "io" - "io/ioutil" - "math" - "os" - "strconv" - "strings" - "time" -) - -var ( - ErrHeader = errors.New("archive/tar: invalid tar header") -) - -const maxNanoSecondIntSize = 9 - -// A Reader provides sequential access to the contents of a tar archive. -// A tar archive consists of a sequence of files. -// The Next method advances to the next file in the archive (including the first), -// and then it can be treated as an io.Reader to access the file's data. -type Reader struct { - r io.Reader - err error - pad int64 // amount of padding (ignored) after current file entry - curr numBytesReader // reader for current file entry - hdrBuff [blockSize]byte // buffer to use in readHeader -} - -type parser struct { - err error // Last error seen -} - -// A numBytesReader is an io.Reader with a numBytes method, returning the number -// of bytes remaining in the underlying encoded data. -type numBytesReader interface { - io.Reader - numBytes() int64 -} - -// A regFileReader is a numBytesReader for reading file data from a tar archive. -type regFileReader struct { - r io.Reader // underlying reader - nb int64 // number of unread bytes for current file entry -} - -// A sparseFileReader is a numBytesReader for reading sparse file data from a -// tar archive. -type sparseFileReader struct { - rfr numBytesReader // Reads the sparse-encoded file data - sp []sparseEntry // The sparse map for the file - pos int64 // Keeps track of file position - total int64 // Total size of the file -} - -// A sparseEntry holds a single entry in a sparse file's sparse map. -// -// Sparse files are represented using a series of sparseEntrys. -// Despite the name, a sparseEntry represents an actual data fragment that -// references data found in the underlying archive stream. All regions not -// covered by a sparseEntry are logically filled with zeros. -// -// For example, if the underlying raw file contains the 10-byte data: -// var compactData = "abcdefgh" -// -// And the sparse map has the following entries: -// var sp = []sparseEntry{ -// {offset: 2, numBytes: 5} // Data fragment for [2..7] -// {offset: 18, numBytes: 3} // Data fragment for [18..21] -// } -// -// Then the content of the resulting sparse file with a "real" size of 25 is: -// var sparseData = "\x00"*2 + "abcde" + "\x00"*11 + "fgh" + "\x00"*4 -type sparseEntry struct { - offset int64 // Starting position of the fragment - numBytes int64 // Length of the fragment -} - -// Keywords for GNU sparse files in a PAX extended header -const ( - paxGNUSparseNumBlocks = "GNU.sparse.numblocks" - paxGNUSparseOffset = "GNU.sparse.offset" - paxGNUSparseNumBytes = "GNU.sparse.numbytes" - paxGNUSparseMap = "GNU.sparse.map" - paxGNUSparseName = "GNU.sparse.name" - paxGNUSparseMajor = "GNU.sparse.major" - paxGNUSparseMinor = "GNU.sparse.minor" - paxGNUSparseSize = "GNU.sparse.size" - paxGNUSparseRealSize = "GNU.sparse.realsize" -) - -// Keywords for old GNU sparse headers -const ( - oldGNUSparseMainHeaderOffset = 386 - oldGNUSparseMainHeaderIsExtendedOffset = 482 - oldGNUSparseMainHeaderNumEntries = 4 - oldGNUSparseExtendedHeaderIsExtendedOffset = 504 - oldGNUSparseExtendedHeaderNumEntries = 21 - oldGNUSparseOffsetSize = 12 - oldGNUSparseNumBytesSize = 12 -) - -// NewReader creates a new Reader reading from r. -func NewReader(r io.Reader) *Reader { return &Reader{r: r} } - -// Next advances to the next entry in the tar archive. -// -// io.EOF is returned at the end of the input. -func (tr *Reader) Next() (*Header, error) { - if tr.err != nil { - return nil, tr.err - } - - var hdr *Header - var extHdrs map[string]string - - // Externally, Next iterates through the tar archive as if it is a series of - // files. Internally, the tar format often uses fake "files" to add meta - // data that describes the next file. These meta data "files" should not - // normally be visible to the outside. As such, this loop iterates through - // one or more "header files" until it finds a "normal file". -loop: - for { - tr.err = tr.skipUnread() - if tr.err != nil { - return nil, tr.err - } - - hdr = tr.readHeader() - if tr.err != nil { - return nil, tr.err - } - - // Check for PAX/GNU special headers and files. - switch hdr.Typeflag { - case TypeXHeader: - extHdrs, tr.err = parsePAX(tr) - if tr.err != nil { - return nil, tr.err - } - continue loop // This is a meta header affecting the next header - case TypeGNULongName, TypeGNULongLink: - var realname []byte - realname, tr.err = ioutil.ReadAll(tr) - if tr.err != nil { - return nil, tr.err - } - - // Convert GNU extensions to use PAX headers. - if extHdrs == nil { - extHdrs = make(map[string]string) - } - var p parser - switch hdr.Typeflag { - case TypeGNULongName: - extHdrs[paxPath] = p.parseString(realname) - case TypeGNULongLink: - extHdrs[paxLinkpath] = p.parseString(realname) - } - if p.err != nil { - tr.err = p.err - return nil, tr.err - } - continue loop // This is a meta header affecting the next header - default: - mergePAX(hdr, extHdrs) - - // Check for a PAX format sparse file - sp, err := tr.checkForGNUSparsePAXHeaders(hdr, extHdrs) - if err != nil { - tr.err = err - return nil, err - } - if sp != nil { - // Current file is a PAX format GNU sparse file. - // Set the current file reader to a sparse file reader. - tr.curr, tr.err = newSparseFileReader(tr.curr, sp, hdr.Size) - if tr.err != nil { - return nil, tr.err - } - } - break loop // This is a file, so stop - } - } - return hdr, nil -} - -// checkForGNUSparsePAXHeaders checks the PAX headers for GNU sparse headers. If they are found, then -// this function reads the sparse map and returns it. Unknown sparse formats are ignored, causing the file to -// be treated as a regular file. -func (tr *Reader) checkForGNUSparsePAXHeaders(hdr *Header, headers map[string]string) ([]sparseEntry, error) { - var sparseFormat string - - // Check for sparse format indicators - major, majorOk := headers[paxGNUSparseMajor] - minor, minorOk := headers[paxGNUSparseMinor] - sparseName, sparseNameOk := headers[paxGNUSparseName] - _, sparseMapOk := headers[paxGNUSparseMap] - sparseSize, sparseSizeOk := headers[paxGNUSparseSize] - sparseRealSize, sparseRealSizeOk := headers[paxGNUSparseRealSize] - - // Identify which, if any, sparse format applies from which PAX headers are set - if majorOk && minorOk { - sparseFormat = major + "." + minor - } else if sparseNameOk && sparseMapOk { - sparseFormat = "0.1" - } else if sparseSizeOk { - sparseFormat = "0.0" - } else { - // Not a PAX format GNU sparse file. - return nil, nil - } - - // Check for unknown sparse format - if sparseFormat != "0.0" && sparseFormat != "0.1" && sparseFormat != "1.0" { - return nil, nil - } - - // Update hdr from GNU sparse PAX headers - if sparseNameOk { - hdr.Name = sparseName - } - if sparseSizeOk { - realSize, err := strconv.ParseInt(sparseSize, 10, 0) - if err != nil { - return nil, ErrHeader - } - hdr.Size = realSize - } else if sparseRealSizeOk { - realSize, err := strconv.ParseInt(sparseRealSize, 10, 0) - if err != nil { - return nil, ErrHeader - } - hdr.Size = realSize - } - - // Set up the sparse map, according to the particular sparse format in use - var sp []sparseEntry - var err error - switch sparseFormat { - case "0.0", "0.1": - sp, err = readGNUSparseMap0x1(headers) - case "1.0": - sp, err = readGNUSparseMap1x0(tr.curr) - } - return sp, err -} - -// mergePAX merges well known headers according to PAX standard. -// In general headers with the same name as those found -// in the header struct overwrite those found in the header -// struct with higher precision or longer values. Esp. useful -// for name and linkname fields. -func mergePAX(hdr *Header, headers map[string]string) error { - for k, v := range headers { - switch k { - case paxPath: - hdr.Name = v - case paxLinkpath: - hdr.Linkname = v - case paxGname: - hdr.Gname = v - case paxUname: - hdr.Uname = v - case paxUid: - uid, err := strconv.ParseInt(v, 10, 0) - if err != nil { - return err - } - hdr.Uid = int(uid) - case paxGid: - gid, err := strconv.ParseInt(v, 10, 0) - if err != nil { - return err - } - hdr.Gid = int(gid) - case paxAtime: - t, err := parsePAXTime(v) - if err != nil { - return err - } - hdr.AccessTime = t - case paxMtime: - t, err := parsePAXTime(v) - if err != nil { - return err - } - hdr.ModTime = t - case paxCtime: - t, err := parsePAXTime(v) - if err != nil { - return err - } - hdr.ChangeTime = t - case paxSize: - size, err := strconv.ParseInt(v, 10, 0) - if err != nil { - return err - } - hdr.Size = int64(size) - default: - if strings.HasPrefix(k, paxXattr) { - if hdr.Xattrs == nil { - hdr.Xattrs = make(map[string]string) - } - hdr.Xattrs[k[len(paxXattr):]] = v - } else if strings.HasPrefix(k, paxWindows) { - if hdr.Winheaders == nil { - hdr.Winheaders = make(map[string]string) - } - hdr.Winheaders[k[len(paxWindows):]] = v - } - } - } - return nil -} - -// parsePAXTime takes a string of the form %d.%d as described in -// the PAX specification. -func parsePAXTime(t string) (time.Time, error) { - buf := []byte(t) - pos := bytes.IndexByte(buf, '.') - var seconds, nanoseconds int64 - var err error - if pos == -1 { - seconds, err = strconv.ParseInt(t, 10, 0) - if err != nil { - return time.Time{}, err - } - } else { - seconds, err = strconv.ParseInt(string(buf[:pos]), 10, 0) - if err != nil { - return time.Time{}, err - } - nano_buf := string(buf[pos+1:]) - // Pad as needed before converting to a decimal. - // For example .030 -> .030000000 -> 30000000 nanoseconds - if len(nano_buf) < maxNanoSecondIntSize { - // Right pad - nano_buf += strings.Repeat("0", maxNanoSecondIntSize-len(nano_buf)) - } else if len(nano_buf) > maxNanoSecondIntSize { - // Right truncate - nano_buf = nano_buf[:maxNanoSecondIntSize] - } - nanoseconds, err = strconv.ParseInt(string(nano_buf), 10, 0) - if err != nil { - return time.Time{}, err - } - } - ts := time.Unix(seconds, nanoseconds) - return ts, nil -} - -// parsePAX parses PAX headers. -// If an extended header (type 'x') is invalid, ErrHeader is returned -func parsePAX(r io.Reader) (map[string]string, error) { - buf, err := ioutil.ReadAll(r) - if err != nil { - return nil, err - } - sbuf := string(buf) - - // For GNU PAX sparse format 0.0 support. - // This function transforms the sparse format 0.0 headers into sparse format 0.1 headers. - var sparseMap bytes.Buffer - - headers := make(map[string]string) - // Each record is constructed as - // "%d %s=%s\n", length, keyword, value - for len(sbuf) > 0 { - key, value, residual, err := parsePAXRecord(sbuf) - if err != nil { - return nil, ErrHeader - } - sbuf = residual - - keyStr := string(key) - if keyStr == paxGNUSparseOffset || keyStr == paxGNUSparseNumBytes { - // GNU sparse format 0.0 special key. Write to sparseMap instead of using the headers map. - sparseMap.WriteString(value) - sparseMap.Write([]byte{','}) - } else { - // Normal key. Set the value in the headers map. - headers[keyStr] = string(value) - } - } - if sparseMap.Len() != 0 { - // Add sparse info to headers, chopping off the extra comma - sparseMap.Truncate(sparseMap.Len() - 1) - headers[paxGNUSparseMap] = sparseMap.String() - } - return headers, nil -} - -// parsePAXRecord parses the input PAX record string into a key-value pair. -// If parsing is successful, it will slice off the currently read record and -// return the remainder as r. -// -// A PAX record is of the following form: -// "%d %s=%s\n" % (size, key, value) -func parsePAXRecord(s string) (k, v, r string, err error) { - // The size field ends at the first space. - sp := strings.IndexByte(s, ' ') - if sp == -1 { - return "", "", s, ErrHeader - } - - // Parse the first token as a decimal integer. - n, perr := strconv.ParseInt(s[:sp], 10, 0) // Intentionally parse as native int - if perr != nil || n < 5 || int64(len(s)) < n { - return "", "", s, ErrHeader - } - - // Extract everything between the space and the final newline. - rec, nl, rem := s[sp+1:n-1], s[n-1:n], s[n:] - if nl != "\n" { - return "", "", s, ErrHeader - } - - // The first equals separates the key from the value. - eq := strings.IndexByte(rec, '=') - if eq == -1 { - return "", "", s, ErrHeader - } - return rec[:eq], rec[eq+1:], rem, nil -} - -// parseString parses bytes as a NUL-terminated C-style string. -// If a NUL byte is not found then the whole slice is returned as a string. -func (*parser) parseString(b []byte) string { - n := 0 - for n < len(b) && b[n] != 0 { - n++ - } - return string(b[0:n]) -} - -// parseNumeric parses the input as being encoded in either base-256 or octal. -// This function may return negative numbers. -// If parsing fails or an integer overflow occurs, err will be set. -func (p *parser) parseNumeric(b []byte) int64 { - // Check for base-256 (binary) format first. - // If the first bit is set, then all following bits constitute a two's - // complement encoded number in big-endian byte order. - if len(b) > 0 && b[0]&0x80 != 0 { - // Handling negative numbers relies on the following identity: - // -a-1 == ^a - // - // If the number is negative, we use an inversion mask to invert the - // data bytes and treat the value as an unsigned number. - var inv byte // 0x00 if positive or zero, 0xff if negative - if b[0]&0x40 != 0 { - inv = 0xff - } - - var x uint64 - for i, c := range b { - c ^= inv // Inverts c only if inv is 0xff, otherwise does nothing - if i == 0 { - c &= 0x7f // Ignore signal bit in first byte - } - if (x >> 56) > 0 { - p.err = ErrHeader // Integer overflow - return 0 - } - x = x<<8 | uint64(c) - } - if (x >> 63) > 0 { - p.err = ErrHeader // Integer overflow - return 0 - } - if inv == 0xff { - return ^int64(x) - } - return int64(x) - } - - // Normal case is base-8 (octal) format. - return p.parseOctal(b) -} - -func (p *parser) parseOctal(b []byte) int64 { - // Because unused fields are filled with NULs, we need - // to skip leading NULs. Fields may also be padded with - // spaces or NULs. - // So we remove leading and trailing NULs and spaces to - // be sure. - b = bytes.Trim(b, " \x00") - - if len(b) == 0 { - return 0 - } - x, perr := strconv.ParseUint(p.parseString(b), 8, 64) - if perr != nil { - p.err = ErrHeader - } - return int64(x) -} - -// skipUnread skips any unread bytes in the existing file entry, as well as any -// alignment padding. It returns io.ErrUnexpectedEOF if any io.EOF is -// encountered in the data portion; it is okay to hit io.EOF in the padding. -// -// Note that this function still works properly even when sparse files are being -// used since numBytes returns the bytes remaining in the underlying io.Reader. -func (tr *Reader) skipUnread() error { - dataSkip := tr.numBytes() // Number of data bytes to skip - totalSkip := dataSkip + tr.pad // Total number of bytes to skip - tr.curr, tr.pad = nil, 0 - - // If possible, Seek to the last byte before the end of the data section. - // Do this because Seek is often lazy about reporting errors; this will mask - // the fact that the tar stream may be truncated. We can rely on the - // io.CopyN done shortly afterwards to trigger any IO errors. - var seekSkipped int64 // Number of bytes skipped via Seek - if sr, ok := tr.r.(io.Seeker); ok && dataSkip > 1 { - // Not all io.Seeker can actually Seek. For example, os.Stdin implements - // io.Seeker, but calling Seek always returns an error and performs - // no action. Thus, we try an innocent seek to the current position - // to see if Seek is really supported. - pos1, err := sr.Seek(0, os.SEEK_CUR) - if err == nil { - // Seek seems supported, so perform the real Seek. - pos2, err := sr.Seek(dataSkip-1, os.SEEK_CUR) - if err != nil { - tr.err = err - return tr.err - } - seekSkipped = pos2 - pos1 - } - } - - var copySkipped int64 // Number of bytes skipped via CopyN - copySkipped, tr.err = io.CopyN(ioutil.Discard, tr.r, totalSkip-seekSkipped) - if tr.err == io.EOF && seekSkipped+copySkipped < dataSkip { - tr.err = io.ErrUnexpectedEOF - } - return tr.err -} - -func (tr *Reader) verifyChecksum(header []byte) bool { - if tr.err != nil { - return false - } - - var p parser - given := p.parseOctal(header[148:156]) - unsigned, signed := checksum(header) - return p.err == nil && (given == unsigned || given == signed) -} - -// readHeader reads the next block header and assumes that the underlying reader -// is already aligned to a block boundary. -// -// The err will be set to io.EOF only when one of the following occurs: -// * Exactly 0 bytes are read and EOF is hit. -// * Exactly 1 block of zeros is read and EOF is hit. -// * At least 2 blocks of zeros are read. -func (tr *Reader) readHeader() *Header { - header := tr.hdrBuff[:] - copy(header, zeroBlock) - - if _, tr.err = io.ReadFull(tr.r, header); tr.err != nil { - return nil // io.EOF is okay here - } - - // Two blocks of zero bytes marks the end of the archive. - if bytes.Equal(header, zeroBlock[0:blockSize]) { - if _, tr.err = io.ReadFull(tr.r, header); tr.err != nil { - return nil // io.EOF is okay here - } - if bytes.Equal(header, zeroBlock[0:blockSize]) { - tr.err = io.EOF - } else { - tr.err = ErrHeader // zero block and then non-zero block - } - return nil - } - - if !tr.verifyChecksum(header) { - tr.err = ErrHeader - return nil - } - - // Unpack - var p parser - hdr := new(Header) - s := slicer(header) - - hdr.Name = p.parseString(s.next(100)) - hdr.Mode = p.parseNumeric(s.next(8)) - hdr.Uid = int(p.parseNumeric(s.next(8))) - hdr.Gid = int(p.parseNumeric(s.next(8))) - hdr.Size = p.parseNumeric(s.next(12)) - hdr.ModTime = time.Unix(p.parseNumeric(s.next(12)), 0) - s.next(8) // chksum - hdr.Typeflag = s.next(1)[0] - hdr.Linkname = p.parseString(s.next(100)) - - // The remainder of the header depends on the value of magic. - // The original (v7) version of tar had no explicit magic field, - // so its magic bytes, like the rest of the block, are NULs. - magic := string(s.next(8)) // contains version field as well. - var format string - switch { - case magic[:6] == "ustar\x00": // POSIX tar (1003.1-1988) - if string(header[508:512]) == "tar\x00" { - format = "star" - } else { - format = "posix" - } - case magic == "ustar \x00": // old GNU tar - format = "gnu" - } - - switch format { - case "posix", "gnu", "star": - hdr.Uname = p.parseString(s.next(32)) - hdr.Gname = p.parseString(s.next(32)) - devmajor := s.next(8) - devminor := s.next(8) - if hdr.Typeflag == TypeChar || hdr.Typeflag == TypeBlock { - hdr.Devmajor = p.parseNumeric(devmajor) - hdr.Devminor = p.parseNumeric(devminor) - } - var prefix string - switch format { - case "posix", "gnu": - prefix = p.parseString(s.next(155)) - case "star": - prefix = p.parseString(s.next(131)) - hdr.AccessTime = time.Unix(p.parseNumeric(s.next(12)), 0) - hdr.ChangeTime = time.Unix(p.parseNumeric(s.next(12)), 0) - } - if len(prefix) > 0 { - hdr.Name = prefix + "/" + hdr.Name - } - } - - if p.err != nil { - tr.err = p.err - return nil - } - - nb := hdr.Size - if isHeaderOnlyType(hdr.Typeflag) { - nb = 0 - } - if nb < 0 { - tr.err = ErrHeader - return nil - } - - // Set the current file reader. - tr.pad = -nb & (blockSize - 1) // blockSize is a power of two - tr.curr = ®FileReader{r: tr.r, nb: nb} - - // Check for old GNU sparse format entry. - if hdr.Typeflag == TypeGNUSparse { - // Get the real size of the file. - hdr.Size = p.parseNumeric(header[483:495]) - if p.err != nil { - tr.err = p.err - return nil - } - - // Read the sparse map. - sp := tr.readOldGNUSparseMap(header) - if tr.err != nil { - return nil - } - - // Current file is a GNU sparse file. Update the current file reader. - tr.curr, tr.err = newSparseFileReader(tr.curr, sp, hdr.Size) - if tr.err != nil { - return nil - } - } - - return hdr -} - -// readOldGNUSparseMap reads the sparse map as stored in the old GNU sparse format. -// The sparse map is stored in the tar header if it's small enough. If it's larger than four entries, -// then one or more extension headers are used to store the rest of the sparse map. -func (tr *Reader) readOldGNUSparseMap(header []byte) []sparseEntry { - var p parser - isExtended := header[oldGNUSparseMainHeaderIsExtendedOffset] != 0 - spCap := oldGNUSparseMainHeaderNumEntries - if isExtended { - spCap += oldGNUSparseExtendedHeaderNumEntries - } - sp := make([]sparseEntry, 0, spCap) - s := slicer(header[oldGNUSparseMainHeaderOffset:]) - - // Read the four entries from the main tar header - for i := 0; i < oldGNUSparseMainHeaderNumEntries; i++ { - offset := p.parseNumeric(s.next(oldGNUSparseOffsetSize)) - numBytes := p.parseNumeric(s.next(oldGNUSparseNumBytesSize)) - if p.err != nil { - tr.err = p.err - return nil - } - if offset == 0 && numBytes == 0 { - break - } - sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes}) - } - - for isExtended { - // There are more entries. Read an extension header and parse its entries. - sparseHeader := make([]byte, blockSize) - if _, tr.err = io.ReadFull(tr.r, sparseHeader); tr.err != nil { - return nil - } - isExtended = sparseHeader[oldGNUSparseExtendedHeaderIsExtendedOffset] != 0 - s = slicer(sparseHeader) - for i := 0; i < oldGNUSparseExtendedHeaderNumEntries; i++ { - offset := p.parseNumeric(s.next(oldGNUSparseOffsetSize)) - numBytes := p.parseNumeric(s.next(oldGNUSparseNumBytesSize)) - if p.err != nil { - tr.err = p.err - return nil - } - if offset == 0 && numBytes == 0 { - break - } - sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes}) - } - } - return sp -} - -// readGNUSparseMap1x0 reads the sparse map as stored in GNU's PAX sparse format -// version 1.0. The format of the sparse map consists of a series of -// newline-terminated numeric fields. The first field is the number of entries -// and is always present. Following this are the entries, consisting of two -// fields (offset, numBytes). This function must stop reading at the end -// boundary of the block containing the last newline. -// -// Note that the GNU manual says that numeric values should be encoded in octal -// format. However, the GNU tar utility itself outputs these values in decimal. -// As such, this library treats values as being encoded in decimal. -func readGNUSparseMap1x0(r io.Reader) ([]sparseEntry, error) { - var cntNewline int64 - var buf bytes.Buffer - var blk = make([]byte, blockSize) - - // feedTokens copies data in numBlock chunks from r into buf until there are - // at least cnt newlines in buf. It will not read more blocks than needed. - var feedTokens = func(cnt int64) error { - for cntNewline < cnt { - if _, err := io.ReadFull(r, blk); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return err - } - buf.Write(blk) - for _, c := range blk { - if c == '\n' { - cntNewline++ - } - } - } - return nil - } - - // nextToken gets the next token delimited by a newline. This assumes that - // at least one newline exists in the buffer. - var nextToken = func() string { - cntNewline-- - tok, _ := buf.ReadString('\n') - return tok[:len(tok)-1] // Cut off newline - } - - // Parse for the number of entries. - // Use integer overflow resistant math to check this. - if err := feedTokens(1); err != nil { - return nil, err - } - numEntries, err := strconv.ParseInt(nextToken(), 10, 0) // Intentionally parse as native int - if err != nil || numEntries < 0 || int(2*numEntries) < int(numEntries) { - return nil, ErrHeader - } - - // Parse for all member entries. - // numEntries is trusted after this since a potential attacker must have - // committed resources proportional to what this library used. - if err := feedTokens(2 * numEntries); err != nil { - return nil, err - } - sp := make([]sparseEntry, 0, numEntries) - for i := int64(0); i < numEntries; i++ { - offset, err := strconv.ParseInt(nextToken(), 10, 64) - if err != nil { - return nil, ErrHeader - } - numBytes, err := strconv.ParseInt(nextToken(), 10, 64) - if err != nil { - return nil, ErrHeader - } - sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes}) - } - return sp, nil -} - -// readGNUSparseMap0x1 reads the sparse map as stored in GNU's PAX sparse format -// version 0.1. The sparse map is stored in the PAX headers. -func readGNUSparseMap0x1(extHdrs map[string]string) ([]sparseEntry, error) { - // Get number of entries. - // Use integer overflow resistant math to check this. - numEntriesStr := extHdrs[paxGNUSparseNumBlocks] - numEntries, err := strconv.ParseInt(numEntriesStr, 10, 0) // Intentionally parse as native int - if err != nil || numEntries < 0 || int(2*numEntries) < int(numEntries) { - return nil, ErrHeader - } - - // There should be two numbers in sparseMap for each entry. - sparseMap := strings.Split(extHdrs[paxGNUSparseMap], ",") - if int64(len(sparseMap)) != 2*numEntries { - return nil, ErrHeader - } - - // Loop through the entries in the sparse map. - // numEntries is trusted now. - sp := make([]sparseEntry, 0, numEntries) - for i := int64(0); i < numEntries; i++ { - offset, err := strconv.ParseInt(sparseMap[2*i], 10, 64) - if err != nil { - return nil, ErrHeader - } - numBytes, err := strconv.ParseInt(sparseMap[2*i+1], 10, 64) - if err != nil { - return nil, ErrHeader - } - sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes}) - } - return sp, nil -} - -// numBytes returns the number of bytes left to read in the current file's entry -// in the tar archive, or 0 if there is no current file. -func (tr *Reader) numBytes() int64 { - if tr.curr == nil { - // No current file, so no bytes - return 0 - } - return tr.curr.numBytes() -} - -// Read reads from the current entry in the tar archive. -// It returns 0, io.EOF when it reaches the end of that entry, -// until Next is called to advance to the next entry. -// -// Calling Read on special types like TypeLink, TypeSymLink, TypeChar, -// TypeBlock, TypeDir, and TypeFifo returns 0, io.EOF regardless of what -// the Header.Size claims. -func (tr *Reader) Read(b []byte) (n int, err error) { - if tr.err != nil { - return 0, tr.err - } - if tr.curr == nil { - return 0, io.EOF - } - - n, err = tr.curr.Read(b) - if err != nil && err != io.EOF { - tr.err = err - } - return -} - -func (rfr *regFileReader) Read(b []byte) (n int, err error) { - if rfr.nb == 0 { - // file consumed - return 0, io.EOF - } - if int64(len(b)) > rfr.nb { - b = b[0:rfr.nb] - } - n, err = rfr.r.Read(b) - rfr.nb -= int64(n) - - if err == io.EOF && rfr.nb > 0 { - err = io.ErrUnexpectedEOF - } - return -} - -// numBytes returns the number of bytes left to read in the file's data in the tar archive. -func (rfr *regFileReader) numBytes() int64 { - return rfr.nb -} - -// newSparseFileReader creates a new sparseFileReader, but validates all of the -// sparse entries before doing so. -func newSparseFileReader(rfr numBytesReader, sp []sparseEntry, total int64) (*sparseFileReader, error) { - if total < 0 { - return nil, ErrHeader // Total size cannot be negative - } - - // Validate all sparse entries. These are the same checks as performed by - // the BSD tar utility. - for i, s := range sp { - switch { - case s.offset < 0 || s.numBytes < 0: - return nil, ErrHeader // Negative values are never okay - case s.offset > math.MaxInt64-s.numBytes: - return nil, ErrHeader // Integer overflow with large length - case s.offset+s.numBytes > total: - return nil, ErrHeader // Region extends beyond the "real" size - case i > 0 && sp[i-1].offset+sp[i-1].numBytes > s.offset: - return nil, ErrHeader // Regions can't overlap and must be in order - } - } - return &sparseFileReader{rfr: rfr, sp: sp, total: total}, nil -} - -// readHole reads a sparse hole ending at endOffset. -func (sfr *sparseFileReader) readHole(b []byte, endOffset int64) int { - n64 := endOffset - sfr.pos - if n64 > int64(len(b)) { - n64 = int64(len(b)) - } - n := int(n64) - for i := 0; i < n; i++ { - b[i] = 0 - } - sfr.pos += n64 - return n -} - -// Read reads the sparse file data in expanded form. -func (sfr *sparseFileReader) Read(b []byte) (n int, err error) { - // Skip past all empty fragments. - for len(sfr.sp) > 0 && sfr.sp[0].numBytes == 0 { - sfr.sp = sfr.sp[1:] - } - - // If there are no more fragments, then it is possible that there - // is one last sparse hole. - if len(sfr.sp) == 0 { - // This behavior matches the BSD tar utility. - // However, GNU tar stops returning data even if sfr.total is unmet. - if sfr.pos < sfr.total { - return sfr.readHole(b, sfr.total), nil - } - return 0, io.EOF - } - - // In front of a data fragment, so read a hole. - if sfr.pos < sfr.sp[0].offset { - return sfr.readHole(b, sfr.sp[0].offset), nil - } - - // In a data fragment, so read from it. - // This math is overflow free since we verify that offset and numBytes can - // be safely added when creating the sparseFileReader. - endPos := sfr.sp[0].offset + sfr.sp[0].numBytes // End offset of fragment - bytesLeft := endPos - sfr.pos // Bytes left in fragment - if int64(len(b)) > bytesLeft { - b = b[:bytesLeft] - } - - n, err = sfr.rfr.Read(b) - sfr.pos += int64(n) - if err == io.EOF { - if sfr.pos < endPos { - err = io.ErrUnexpectedEOF // There was supposed to be more data - } else if sfr.pos < sfr.total { - err = nil // There is still an implicit sparse hole at the end - } - } - - if sfr.pos == endPos { - sfr.sp = sfr.sp[1:] // We are done with this fragment, so pop it - } - return n, err -} - -// numBytes returns the number of bytes left to read in the sparse file's -// sparse-encoded data in the tar archive. -func (sfr *sparseFileReader) numBytes() int64 { - return sfr.rfr.numBytes() -} diff --git a/vendor/github.com/Microsoft/go-winio/archive/tar/stat_atim.go b/vendor/github.com/Microsoft/go-winio/archive/tar/stat_atim.go deleted file mode 100644 index cf9cc79c591..00000000000 --- a/vendor/github.com/Microsoft/go-winio/archive/tar/stat_atim.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 linux dragonfly openbsd solaris - -package tar - -import ( - "syscall" - "time" -) - -func statAtime(st *syscall.Stat_t) time.Time { - return time.Unix(st.Atim.Unix()) -} - -func statCtime(st *syscall.Stat_t) time.Time { - return time.Unix(st.Ctim.Unix()) -} diff --git a/vendor/github.com/Microsoft/go-winio/archive/tar/stat_atimespec.go b/vendor/github.com/Microsoft/go-winio/archive/tar/stat_atimespec.go deleted file mode 100644 index 6f17dbe3072..00000000000 --- a/vendor/github.com/Microsoft/go-winio/archive/tar/stat_atimespec.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 darwin freebsd netbsd - -package tar - -import ( - "syscall" - "time" -) - -func statAtime(st *syscall.Stat_t) time.Time { - return time.Unix(st.Atimespec.Unix()) -} - -func statCtime(st *syscall.Stat_t) time.Time { - return time.Unix(st.Ctimespec.Unix()) -} diff --git a/vendor/github.com/Microsoft/go-winio/archive/tar/stat_unix.go b/vendor/github.com/Microsoft/go-winio/archive/tar/stat_unix.go deleted file mode 100644 index cb843db4cfd..00000000000 --- a/vendor/github.com/Microsoft/go-winio/archive/tar/stat_unix.go +++ /dev/null @@ -1,32 +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 linux darwin dragonfly freebsd openbsd netbsd solaris - -package tar - -import ( - "os" - "syscall" -) - -func init() { - sysStat = statUnix -} - -func statUnix(fi os.FileInfo, h *Header) error { - sys, ok := fi.Sys().(*syscall.Stat_t) - if !ok { - return nil - } - h.Uid = int(sys.Uid) - h.Gid = int(sys.Gid) - // TODO(bradfitz): populate username & group. os/user - // doesn't cache LookupId lookups, and lacks group - // lookup functions. - h.AccessTime = statAtime(sys) - h.ChangeTime = statCtime(sys) - // TODO(bradfitz): major/minor device numbers? - return nil -} diff --git a/vendor/github.com/Microsoft/go-winio/archive/tar/writer.go b/vendor/github.com/Microsoft/go-winio/archive/tar/writer.go deleted file mode 100644 index 05027a35a4e..00000000000 --- a/vendor/github.com/Microsoft/go-winio/archive/tar/writer.go +++ /dev/null @@ -1,419 +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 tar - -// TODO(dsymonds): -// - catch more errors (no first header, etc.) - -import ( - "bytes" - "errors" - "fmt" - "io" - "path" - "sort" - "strconv" - "strings" - "time" -) - -var ( - ErrWriteTooLong = errors.New("archive/tar: write too long") - ErrFieldTooLong = errors.New("archive/tar: header field too long") - ErrWriteAfterClose = errors.New("archive/tar: write after close") - errInvalidHeader = errors.New("archive/tar: header field too long or contains invalid values") -) - -// A Writer provides sequential writing of a tar archive in POSIX.1 format. -// A tar archive consists of a sequence of files. -// Call WriteHeader to begin a new file, and then call Write to supply that file's data, -// writing at most hdr.Size bytes in total. -type Writer struct { - w io.Writer - err error - nb int64 // number of unwritten bytes for current file entry - pad int64 // amount of padding to write after current file entry - closed bool - usedBinary bool // whether the binary numeric field extension was used - preferPax bool // use pax header instead of binary numeric header - hdrBuff [blockSize]byte // buffer to use in writeHeader when writing a regular header - paxHdrBuff [blockSize]byte // buffer to use in writeHeader when writing a pax header -} - -type formatter struct { - err error // Last error seen -} - -// NewWriter creates a new Writer writing to w. -func NewWriter(w io.Writer) *Writer { return &Writer{w: w} } - -// Flush finishes writing the current file (optional). -func (tw *Writer) Flush() error { - if tw.nb > 0 { - tw.err = fmt.Errorf("archive/tar: missed writing %d bytes", tw.nb) - return tw.err - } - - n := tw.nb + tw.pad - for n > 0 && tw.err == nil { - nr := n - if nr > blockSize { - nr = blockSize - } - var nw int - nw, tw.err = tw.w.Write(zeroBlock[0:nr]) - n -= int64(nw) - } - tw.nb = 0 - tw.pad = 0 - return tw.err -} - -// Write s into b, terminating it with a NUL if there is room. -func (f *formatter) formatString(b []byte, s string) { - if len(s) > len(b) { - f.err = ErrFieldTooLong - return - } - ascii := toASCII(s) - copy(b, ascii) - if len(ascii) < len(b) { - b[len(ascii)] = 0 - } -} - -// Encode x as an octal ASCII string and write it into b with leading zeros. -func (f *formatter) formatOctal(b []byte, x int64) { - s := strconv.FormatInt(x, 8) - // leading zeros, but leave room for a NUL. - for len(s)+1 < len(b) { - s = "0" + s - } - f.formatString(b, s) -} - -// fitsInBase256 reports whether x can be encoded into n bytes using base-256 -// encoding. Unlike octal encoding, base-256 encoding does not require that the -// string ends with a NUL character. Thus, all n bytes are available for output. -// -// If operating in binary mode, this assumes strict GNU binary mode; which means -// that the first byte can only be either 0x80 or 0xff. Thus, the first byte is -// equivalent to the sign bit in two's complement form. -func fitsInBase256(n int, x int64) bool { - var binBits = uint(n-1) * 8 - return n >= 9 || (x >= -1<= 0; i-- { - b[i] = byte(x) - x >>= 8 - } - b[0] |= 0x80 // Highest bit indicates binary format - return - } - - f.formatOctal(b, 0) // Last resort, just write zero - f.err = ErrFieldTooLong -} - -var ( - minTime = time.Unix(0, 0) - // There is room for 11 octal digits (33 bits) of mtime. - maxTime = minTime.Add((1<<33 - 1) * time.Second) -) - -// WriteHeader writes hdr and prepares to accept the file's contents. -// WriteHeader calls Flush if it is not the first header. -// Calling after a Close will return ErrWriteAfterClose. -func (tw *Writer) WriteHeader(hdr *Header) error { - return tw.writeHeader(hdr, true) -} - -// WriteHeader writes hdr and prepares to accept the file's contents. -// WriteHeader calls Flush if it is not the first header. -// Calling after a Close will return ErrWriteAfterClose. -// As this method is called internally by writePax header to allow it to -// suppress writing the pax header. -func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error { - if tw.closed { - return ErrWriteAfterClose - } - if tw.err == nil { - tw.Flush() - } - if tw.err != nil { - return tw.err - } - - // a map to hold pax header records, if any are needed - paxHeaders := make(map[string]string) - - // TODO(shanemhansen): we might want to use PAX headers for - // subsecond time resolution, but for now let's just capture - // too long fields or non ascii characters - - var f formatter - var header []byte - - // We need to select which scratch buffer to use carefully, - // since this method is called recursively to write PAX headers. - // If allowPax is true, this is the non-recursive call, and we will use hdrBuff. - // If allowPax is false, we are being called by writePAXHeader, and hdrBuff is - // already being used by the non-recursive call, so we must use paxHdrBuff. - header = tw.hdrBuff[:] - if !allowPax { - header = tw.paxHdrBuff[:] - } - copy(header, zeroBlock) - s := slicer(header) - - // Wrappers around formatter that automatically sets paxHeaders if the - // argument extends beyond the capacity of the input byte slice. - var formatString = func(b []byte, s string, paxKeyword string) { - needsPaxHeader := paxKeyword != paxNone && len(s) > len(b) || !isASCII(s) - if needsPaxHeader { - paxHeaders[paxKeyword] = s - return - } - f.formatString(b, s) - } - var formatNumeric = func(b []byte, x int64, paxKeyword string) { - // Try octal first. - s := strconv.FormatInt(x, 8) - if len(s) < len(b) { - f.formatOctal(b, x) - return - } - - // If it is too long for octal, and PAX is preferred, use a PAX header. - if paxKeyword != paxNone && tw.preferPax { - f.formatOctal(b, 0) - s := strconv.FormatInt(x, 10) - paxHeaders[paxKeyword] = s - return - } - - tw.usedBinary = true - f.formatNumeric(b, x) - } - - // keep a reference to the filename to allow to overwrite it later if we detect that we can use ustar longnames instead of pax - pathHeaderBytes := s.next(fileNameSize) - - formatString(pathHeaderBytes, hdr.Name, paxPath) - - // Handle out of range ModTime carefully. - var modTime int64 - if !hdr.ModTime.Before(minTime) && !hdr.ModTime.After(maxTime) { - modTime = hdr.ModTime.Unix() - } - - f.formatOctal(s.next(8), hdr.Mode) // 100:108 - formatNumeric(s.next(8), int64(hdr.Uid), paxUid) // 108:116 - formatNumeric(s.next(8), int64(hdr.Gid), paxGid) // 116:124 - formatNumeric(s.next(12), hdr.Size, paxSize) // 124:136 - formatNumeric(s.next(12), modTime, paxNone) // 136:148 --- consider using pax for finer granularity - s.next(8) // chksum (148:156) - s.next(1)[0] = hdr.Typeflag // 156:157 - - formatString(s.next(100), hdr.Linkname, paxLinkpath) - - copy(s.next(8), []byte("ustar\x0000")) // 257:265 - formatString(s.next(32), hdr.Uname, paxUname) // 265:297 - formatString(s.next(32), hdr.Gname, paxGname) // 297:329 - formatNumeric(s.next(8), hdr.Devmajor, paxNone) // 329:337 - formatNumeric(s.next(8), hdr.Devminor, paxNone) // 337:345 - - // keep a reference to the prefix to allow to overwrite it later if we detect that we can use ustar longnames instead of pax - prefixHeaderBytes := s.next(155) - formatString(prefixHeaderBytes, "", paxNone) // 345:500 prefix - - // Use the GNU magic instead of POSIX magic if we used any GNU extensions. - if tw.usedBinary { - copy(header[257:265], []byte("ustar \x00")) - } - - _, paxPathUsed := paxHeaders[paxPath] - // try to use a ustar header when only the name is too long - if !tw.preferPax && len(paxHeaders) == 1 && paxPathUsed { - prefix, suffix, ok := splitUSTARPath(hdr.Name) - if ok { - // Since we can encode in USTAR format, disable PAX header. - delete(paxHeaders, paxPath) - - // Update the path fields - formatString(pathHeaderBytes, suffix, paxNone) - formatString(prefixHeaderBytes, prefix, paxNone) - } - } - - // The chksum field is terminated by a NUL and a space. - // This is different from the other octal fields. - chksum, _ := checksum(header) - f.formatOctal(header[148:155], chksum) // Never fails - header[155] = ' ' - - // Check if there were any formatting errors. - if f.err != nil { - tw.err = f.err - return tw.err - } - - if allowPax { - for k, v := range hdr.Xattrs { - paxHeaders[paxXattr+k] = v - } - for k, v := range hdr.Winheaders { - paxHeaders[paxWindows+k] = v - } - } - - if len(paxHeaders) > 0 { - if !allowPax { - return errInvalidHeader - } - if err := tw.writePAXHeader(hdr, paxHeaders); err != nil { - return err - } - } - tw.nb = int64(hdr.Size) - tw.pad = (blockSize - (tw.nb % blockSize)) % blockSize - - _, tw.err = tw.w.Write(header) - return tw.err -} - -// splitUSTARPath splits a path according to USTAR prefix and suffix rules. -// If the path is not splittable, then it will return ("", "", false). -func splitUSTARPath(name string) (prefix, suffix string, ok bool) { - length := len(name) - if length <= fileNameSize || !isASCII(name) { - return "", "", false - } else if length > fileNamePrefixSize+1 { - length = fileNamePrefixSize + 1 - } else if name[length-1] == '/' { - length-- - } - - i := strings.LastIndex(name[:length], "/") - nlen := len(name) - i - 1 // nlen is length of suffix - plen := i // plen is length of prefix - if i <= 0 || nlen > fileNameSize || nlen == 0 || plen > fileNamePrefixSize { - return "", "", false - } - return name[:i], name[i+1:], true -} - -// writePaxHeader writes an extended pax header to the -// archive. -func (tw *Writer) writePAXHeader(hdr *Header, paxHeaders map[string]string) error { - // Prepare extended header - ext := new(Header) - ext.Typeflag = TypeXHeader - // Setting ModTime is required for reader parsing to - // succeed, and seems harmless enough. - ext.ModTime = hdr.ModTime - // The spec asks that we namespace our pseudo files - // with the current pid. However, this results in differing outputs - // for identical inputs. As such, the constant 0 is now used instead. - // golang.org/issue/12358 - dir, file := path.Split(hdr.Name) - fullName := path.Join(dir, "PaxHeaders.0", file) - - ascii := toASCII(fullName) - if len(ascii) > 100 { - ascii = ascii[:100] - } - ext.Name = ascii - // Construct the body - var buf bytes.Buffer - - // Keys are sorted before writing to body to allow deterministic output. - var keys []string - for k := range paxHeaders { - keys = append(keys, k) - } - sort.Strings(keys) - - for _, k := range keys { - fmt.Fprint(&buf, formatPAXRecord(k, paxHeaders[k])) - } - - ext.Size = int64(len(buf.Bytes())) - if err := tw.writeHeader(ext, false); err != nil { - return err - } - if _, err := tw.Write(buf.Bytes()); err != nil { - return err - } - if err := tw.Flush(); err != nil { - return err - } - return nil -} - -// formatPAXRecord formats a single PAX record, prefixing it with the -// appropriate length. -func formatPAXRecord(k, v string) string { - const padding = 3 // Extra padding for ' ', '=', and '\n' - size := len(k) + len(v) + padding - size += len(strconv.Itoa(size)) - record := fmt.Sprintf("%d %s=%s\n", size, k, v) - - // Final adjustment if adding size field increased the record size. - if len(record) != size { - size = len(record) - record = fmt.Sprintf("%d %s=%s\n", size, k, v) - } - return record -} - -// Write writes to the current entry in the tar archive. -// Write returns the error ErrWriteTooLong if more than -// hdr.Size bytes are written after WriteHeader. -func (tw *Writer) Write(b []byte) (n int, err error) { - if tw.closed { - err = ErrWriteAfterClose - return - } - overwrite := false - if int64(len(b)) > tw.nb { - b = b[0:tw.nb] - overwrite = true - } - n, err = tw.w.Write(b) - tw.nb -= int64(n) - if err == nil && overwrite { - err = ErrWriteTooLong - return - } - tw.err = err - return -} - -// Close closes the tar archive, flushing any unwritten -// data to the underlying writer. -func (tw *Writer) Close() error { - if tw.err != nil || tw.closed { - return tw.err - } - tw.Flush() - tw.closed = true - if tw.err != nil { - return tw.err - } - - // trailer: two zero blocks - for i := 0; i < 2; i++ { - _, tw.err = tw.w.Write(zeroBlock) - if tw.err != nil { - break - } - } - return tw.err -} diff --git a/vendor/github.com/Microsoft/go-winio/backuptar/tar.go b/vendor/github.com/Microsoft/go-winio/backuptar/tar.go deleted file mode 100644 index c988574fdf6..00000000000 --- a/vendor/github.com/Microsoft/go-winio/backuptar/tar.go +++ /dev/null @@ -1,362 +0,0 @@ -package backuptar - -import ( - "errors" - "fmt" - "io" - "io/ioutil" - "path/filepath" - "strconv" - "strings" - "syscall" - "time" - - "github.com/Microsoft/go-winio" - "github.com/Microsoft/go-winio/archive/tar" // until archive/tar supports pax extensions in its interface -) - -const ( - c_ISUID = 04000 // Set uid - c_ISGID = 02000 // Set gid - c_ISVTX = 01000 // Save text (sticky bit) - c_ISDIR = 040000 // Directory - c_ISFIFO = 010000 // FIFO - c_ISREG = 0100000 // Regular file - c_ISLNK = 0120000 // Symbolic link - c_ISBLK = 060000 // Block special file - c_ISCHR = 020000 // Character special file - c_ISSOCK = 0140000 // Socket -) - -const ( - hdrFileAttributes = "fileattr" - hdrAccessTime = "accesstime" - hdrChangeTime = "changetime" - hdrCreateTime = "createtime" - hdrWriteTime = "writetime" - hdrSecurityDescriptor = "sd" - hdrMountPoint = "mountpoint" -) - -func writeZeroes(w io.Writer, count int64) error { - buf := make([]byte, 8192) - c := len(buf) - for i := int64(0); i < count; i += int64(c) { - if int64(c) > count-i { - c = int(count - i) - } - _, err := w.Write(buf[:c]) - if err != nil { - return err - } - } - return nil -} - -func copySparse(t *tar.Writer, br *winio.BackupStreamReader) error { - curOffset := int64(0) - for { - bhdr, err := br.Next() - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - if err != nil { - return err - } - if bhdr.Id != winio.BackupSparseBlock { - return fmt.Errorf("unexpected stream %d", bhdr.Id) - } - - // archive/tar does not support writing sparse files - // so just write zeroes to catch up to the current offset. - err = writeZeroes(t, bhdr.Offset-curOffset) - if bhdr.Size == 0 { - break - } - n, err := io.Copy(t, br) - if err != nil { - return err - } - curOffset = bhdr.Offset + n - } - return nil -} - -func win32TimeFromTar(key string, hdrs map[string]string, unixTime time.Time) syscall.Filetime { - if s, ok := hdrs[key]; ok { - n, err := strconv.ParseUint(s, 10, 64) - if err == nil { - return syscall.Filetime{uint32(n & 0xffffffff), uint32(n >> 32)} - } - } - return syscall.NsecToFiletime(unixTime.UnixNano()) -} - -func win32TimeToTar(ft syscall.Filetime) (string, time.Time) { - return fmt.Sprintf("%d", uint64(ft.LowDateTime)+(uint64(ft.HighDateTime)<<32)), time.Unix(0, ft.Nanoseconds()) -} - -// Writes a file to a tar writer using data from a Win32 backup stream. -// -// This encodes Win32 metadata as tar pax vendor extensions starting with MSWINDOWS. -// -// The additional Win32 metadata is: -// -// MSWINDOWS.fileattr: The Win32 file attributes, as a decimal value -// -// MSWINDOWS.accesstime: The last access time, as a Filetime expressed as a 64-bit decimal value. -// -// MSWINDOWS.createtime: The creation time, as a Filetime expressed as a 64-bit decimal value. -// -// MSWINDOWS.changetime: The creation time, as a Filetime expressed as a 64-bit decimal value. -// -// MSWINDOWS.writetime: The creation time, as a Filetime expressed as a 64-bit decimal value. -// -// MSWINDOWS.sd: The Win32 security descriptor, in SDDL (string) format -// -// MSWINDOWS.mountpoint: If present, this is a mount point and not a symlink, even though the type is '2' (symlink) -func WriteTarFileFromBackupStream(t *tar.Writer, r io.Reader, name string, size int64, fileInfo *winio.FileBasicInfo) error { - name = filepath.ToSlash(name) - hdr := &tar.Header{ - Name: name, - Size: size, - Typeflag: tar.TypeReg, - Winheaders: make(map[string]string), - } - hdr.Winheaders[hdrFileAttributes] = fmt.Sprintf("%d", fileInfo.FileAttributes) - hdr.Winheaders[hdrAccessTime], hdr.AccessTime = win32TimeToTar(fileInfo.LastAccessTime) - hdr.Winheaders[hdrChangeTime], hdr.ChangeTime = win32TimeToTar(fileInfo.ChangeTime) - hdr.Winheaders[hdrCreateTime], _ = win32TimeToTar(fileInfo.CreationTime) - hdr.Winheaders[hdrWriteTime], hdr.ModTime = win32TimeToTar(fileInfo.LastWriteTime) - - if (fileInfo.FileAttributes & syscall.FILE_ATTRIBUTE_DIRECTORY) != 0 { - hdr.Mode |= c_ISDIR - hdr.Size = 0 - hdr.Typeflag = tar.TypeDir - } - - br := winio.NewBackupStreamReader(r) - var dataHdr *winio.BackupHeader - for dataHdr == nil { - bhdr, err := br.Next() - if err == io.EOF { - break - } - if err != nil { - return err - } - switch bhdr.Id { - case winio.BackupData: - hdr.Mode |= c_ISREG - dataHdr = bhdr - case winio.BackupSecurity: - sd, err := ioutil.ReadAll(br) - if err != nil { - return err - } - sddl, err := winio.SecurityDescriptorToSddl(sd) - if err != nil { - return err - } - hdr.Winheaders[hdrSecurityDescriptor] = sddl - - case winio.BackupReparseData: - hdr.Mode |= c_ISLNK - hdr.Typeflag = tar.TypeSymlink - reparseBuffer, err := ioutil.ReadAll(br) - rp, err := winio.DecodeReparsePoint(reparseBuffer) - if err != nil { - return err - } - if rp.IsMountPoint { - hdr.Winheaders[hdrMountPoint] = "1" - } - hdr.Linkname = rp.Target - case winio.BackupEaData, winio.BackupLink, winio.BackupPropertyData, winio.BackupObjectId, winio.BackupTxfsData: - // ignore these streams - default: - return fmt.Errorf("%s: unknown stream ID %d", name, bhdr.Id) - } - } - - err := t.WriteHeader(hdr) - if err != nil { - return err - } - - if dataHdr != nil { - // A data stream was found. Copy the data. - if (dataHdr.Attributes & winio.StreamSparseAttributes) == 0 { - if size != dataHdr.Size { - return fmt.Errorf("%s: mismatch between file size %d and header size %d", name, size, dataHdr.Size) - } - _, err = io.Copy(t, br) - if err != nil { - return err - } - } else { - err = copySparse(t, br) - if err != nil { - return err - } - } - } - - // Look for streams after the data stream. The only ones we handle are alternate data streams. - // Other streams may have metadata that could be serialized, but the tar header has already - // been written. In practice, this means that we don't get EA or TXF metadata. - for { - bhdr, err := br.Next() - if err == io.EOF { - break - } - if err != nil { - return err - } - switch bhdr.Id { - case winio.BackupAlternateData: - altName := bhdr.Name - if strings.HasSuffix(altName, ":$DATA") { - altName = altName[:len(altName)-len(":$DATA")] - } - if (bhdr.Attributes & winio.StreamSparseAttributes) == 0 { - hdr = &tar.Header{ - Name: name + altName, - Mode: hdr.Mode, - Typeflag: tar.TypeReg, - Size: bhdr.Size, - ModTime: hdr.ModTime, - AccessTime: hdr.AccessTime, - ChangeTime: hdr.ChangeTime, - } - err = t.WriteHeader(hdr) - if err != nil { - return err - } - _, err = io.Copy(t, br) - if err != nil { - return err - } - - } else { - // Unsupported for now, since the size of the alternate stream is not present - // in the backup stream until after the data has been read. - return errors.New("tar of sparse alternate data streams is unsupported") - } - case winio.BackupEaData, winio.BackupLink, winio.BackupPropertyData, winio.BackupObjectId, winio.BackupTxfsData: - // ignore these streams - default: - return fmt.Errorf("%s: unknown stream ID %d after data", name, bhdr.Id) - } - } - return nil -} - -// Retrieves basic Win32 file information from a tar header, using the additional metadata written by -// WriteTarFileFromBackupStream. -func FileInfoFromHeader(hdr *tar.Header) (name string, size int64, fileInfo *winio.FileBasicInfo, err error) { - name = hdr.Name - if hdr.Typeflag == tar.TypeReg || hdr.Typeflag == tar.TypeRegA { - size = hdr.Size - } - fileInfo = &winio.FileBasicInfo{ - LastAccessTime: win32TimeFromTar(hdrAccessTime, hdr.Winheaders, hdr.AccessTime), - LastWriteTime: win32TimeFromTar(hdrWriteTime, hdr.Winheaders, hdr.ModTime), - ChangeTime: win32TimeFromTar(hdrChangeTime, hdr.Winheaders, hdr.ChangeTime), - CreationTime: win32TimeFromTar(hdrCreateTime, hdr.Winheaders, hdr.ModTime), - } - if attrStr, ok := hdr.Winheaders[hdrFileAttributes]; ok { - attr, err := strconv.ParseUint(attrStr, 10, 32) - if err != nil { - return "", 0, nil, err - } - fileInfo.FileAttributes = uintptr(attr) - } else { - if hdr.Typeflag == tar.TypeDir { - fileInfo.FileAttributes |= syscall.FILE_ATTRIBUTE_DIRECTORY - } - } - return -} - -// Writes a Win32 backup stream from the current tar file. Since this function may process multiple -// tar file entries in order to collect all the alternate data streams for the file, it returns the next -// tar file that was not processed, or io.EOF is there are no more. -func WriteBackupStreamFromTarFile(w io.Writer, t *tar.Reader, hdr *tar.Header) (*tar.Header, error) { - bw := winio.NewBackupStreamWriter(w) - if sddl, ok := hdr.Winheaders[hdrSecurityDescriptor]; ok { - sd, err := winio.SddlToSecurityDescriptor(sddl) - if err != nil { - return nil, err - } - bhdr := winio.BackupHeader{ - Id: winio.BackupSecurity, - Size: int64(len(sd)), - } - err = bw.WriteHeader(&bhdr) - if err != nil { - return nil, err - } - _, err = bw.Write(sd) - if err != nil { - return nil, err - } - } - if hdr.Typeflag == tar.TypeSymlink { - _, isMountPoint := hdr.Winheaders[hdrMountPoint] - rp := winio.ReparsePoint{ - Target: hdr.Linkname, - IsMountPoint: isMountPoint, - } - reparse := winio.EncodeReparsePoint(&rp) - bhdr := winio.BackupHeader{ - Id: winio.BackupReparseData, - Size: int64(len(reparse)), - } - err := bw.WriteHeader(&bhdr) - if err != nil { - return nil, err - } - _, err = bw.Write(reparse) - if err != nil { - return nil, err - } - } - if hdr.Typeflag == tar.TypeReg || hdr.Typeflag == tar.TypeRegA { - bhdr := winio.BackupHeader{ - Id: winio.BackupData, - Size: hdr.Size, - } - err := bw.WriteHeader(&bhdr) - if err != nil { - return nil, err - } - _, err = io.Copy(bw, t) - if err != nil { - return nil, err - } - } - // Copy all the alternate data streams and return the next non-ADS header. - for { - ahdr, err := t.Next() - if err != nil { - return nil, err - } - if ahdr.Typeflag != tar.TypeReg || !strings.HasPrefix(ahdr.Name, hdr.Name+":") { - return ahdr, nil - } - bhdr := winio.BackupHeader{ - Id: winio.BackupAlternateData, - Size: ahdr.Size, - Name: ahdr.Name[len(hdr.Name)+1:] + ":$DATA", - } - err = bw.WriteHeader(&bhdr) - if err != nil { - return nil, err - } - _, err = io.Copy(bw, t) - if err != nil { - return nil, err - } - } -} diff --git a/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go b/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go deleted file mode 100644 index a62ba45de50..00000000000 --- a/vendor/github.com/Sirupsen/logrus/examples/basic/basic.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "github.com/Sirupsen/logrus" -) - -var log = logrus.New() - -func init() { - log.Formatter = new(logrus.JSONFormatter) - log.Formatter = new(logrus.TextFormatter) // default -} - -func main() { - defer func() { - err := recover() - if err != nil { - log.WithFields(logrus.Fields{ - "omg": true, - "err": err, - "number": 100, - }).Fatal("The ice breaks!") - } - }() - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(logrus.Fields{ - "animal": "orca", - "size": 9009, - }).Panic("It's over 9000!") -} diff --git a/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go b/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go deleted file mode 100644 index 42e7a4c9825..00000000000 --- a/vendor/github.com/Sirupsen/logrus/examples/hook/hook.go +++ /dev/null @@ -1,35 +0,0 @@ -package main - -import ( - "github.com/Sirupsen/logrus" - "github.com/Sirupsen/logrus/hooks/airbrake" - "github.com/tobi/airbrake-go" -) - -var log = logrus.New() - -func init() { - log.Formatter = new(logrus.TextFormatter) // default - log.Hooks.Add(new(logrus_airbrake.AirbrakeHook)) -} - -func main() { - airbrake.Endpoint = "https://exceptions.whatever.com/notifier_api/v2/notices.xml" - airbrake.ApiKey = "whatever" - airbrake.Environment = "production" - - log.WithFields(logrus.Fields{ - "animal": "walrus", - "size": 10, - }).Info("A group of walrus emerges from the ocean") - - log.WithFields(logrus.Fields{ - "omg": true, - "number": 122, - }).Warn("The group's number increased tremendously!") - - log.WithFields(logrus.Fields{ - "omg": true, - "number": 100, - }).Fatal("The ice breaks!") -} diff --git a/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go b/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go deleted file mode 100644 index 880d21ecdc1..00000000000 --- a/vendor/github.com/Sirupsen/logrus/hooks/airbrake/airbrake.go +++ /dev/null @@ -1,54 +0,0 @@ -package logrus_airbrake - -import ( - "github.com/Sirupsen/logrus" - "github.com/tobi/airbrake-go" -) - -// AirbrakeHook to send exceptions to an exception-tracking service compatible -// with the Airbrake API. You must set: -// * airbrake.Endpoint -// * airbrake.ApiKey -// * airbrake.Environment (only sends exceptions when set to "production") -// -// Before using this hook, to send an error. Entries that trigger an Error, -// Fatal or Panic should now include an "error" field to send to Airbrake. -type AirbrakeHook struct{} - -func (hook *AirbrakeHook) Fire(entry *logrus.Entry) error { - if entry.Data["error"] == nil { - entry.Logger.WithFields(logrus.Fields{ - "source": "airbrake", - "endpoint": airbrake.Endpoint, - }).Warn("Exceptions sent to Airbrake must have an 'error' key with the error") - return nil - } - - err, ok := entry.Data["error"].(error) - if !ok { - entry.Logger.WithFields(logrus.Fields{ - "source": "airbrake", - "endpoint": airbrake.Endpoint, - }).Warn("Exceptions sent to Airbrake must have an `error` key of type `error`") - return nil - } - - airErr := airbrake.Notify(err) - if airErr != nil { - entry.Logger.WithFields(logrus.Fields{ - "source": "airbrake", - "endpoint": airbrake.Endpoint, - "error": airErr, - }).Warn("Failed to send error to Airbrake") - } - - return nil -} - -func (hook *AirbrakeHook) Levels() []logrus.Level { - return []logrus.Level{ - logrus.ErrorLevel, - logrus.FatalLevel, - logrus.PanicLevel, - } -} diff --git a/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md b/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md deleted file mode 100644 index ae61e9229ab..00000000000 --- a/vendor/github.com/Sirupsen/logrus/hooks/papertrail/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Papertrail Hook for Logrus :walrus: - -[Papertrail](https://papertrailapp.com) provides hosted log management. Once stored in Papertrail, you can [group](http://help.papertrailapp.com/kb/how-it-works/groups/) your logs on various dimensions, [search](http://help.papertrailapp.com/kb/how-it-works/search-syntax) them, and trigger [alerts](http://help.papertrailapp.com/kb/how-it-works/alerts). - -In most deployments, you'll want to send logs to Papertrail via their [remote_syslog](http://help.papertrailapp.com/kb/configuration/configuring-centralized-logging-from-text-log-files-in-unix/) daemon, which requires no application-specific configuration. This hook is intended for relatively low-volume logging, likely in managed cloud hosting deployments where installing `remote_syslog` is not possible. - -## Usage - -You can find your Papertrail UDP port on your [Papertrail account page](https://papertrailapp.com/account/destinations). Substitute it below for `YOUR_PAPERTRAIL_UDP_PORT`. - -For `YOUR_APP_NAME`, substitute a short string that will readily identify your application or service in the logs. - -```go -import ( - "log/syslog" - "github.com/Sirupsen/logrus" - "github.com/Sirupsen/logrus/hooks/papertrail" -) - -func main() { - log := logrus.New() - hook, err := logrus_papertrail.NewPapertrailHook("logs.papertrailapp.com", YOUR_PAPERTRAIL_UDP_PORT, YOUR_APP_NAME) - - if err == nil { - log.Hooks.Add(hook) - } -} -``` diff --git a/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go b/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go deleted file mode 100644 index 12c56f293d0..00000000000 --- a/vendor/github.com/Sirupsen/logrus/hooks/papertrail/papertrail.go +++ /dev/null @@ -1,54 +0,0 @@ -package logrus_papertrail - -import ( - "fmt" - "net" - "os" - "time" - - "github.com/Sirupsen/logrus" -) - -const ( - format = "Jan 2 15:04:05" -) - -// PapertrailHook to send logs to a logging service compatible with the Papertrail API. -type PapertrailHook struct { - Host string - Port int - AppName string - UDPConn net.Conn -} - -// NewPapertrailHook creates a hook to be added to an instance of logger. -func NewPapertrailHook(host string, port int, appName string) (*PapertrailHook, error) { - conn, err := net.Dial("udp", fmt.Sprintf("%s:%d", host, port)) - return &PapertrailHook{host, port, appName, conn}, err -} - -// Fire is called when a log event is fired. -func (hook *PapertrailHook) Fire(entry *logrus.Entry) error { - date := time.Now().Format(format) - payload := fmt.Sprintf("<22> %s %s: [%s] %s", date, hook.AppName, entry.Level, entry.Message) - - bytesWritten, err := hook.UDPConn.Write([]byte(payload)) - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to send log line to Papertrail via UDP. Wrote %d bytes before error: %v", bytesWritten, err) - return err - } - - return nil -} - -// Levels returns the available logging levels. -func (hook *PapertrailHook) Levels() []logrus.Level { - return []logrus.Level{ - logrus.PanicLevel, - logrus.FatalLevel, - logrus.ErrorLevel, - logrus.WarnLevel, - logrus.InfoLevel, - logrus.DebugLevel, - } -} diff --git a/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md b/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md deleted file mode 100644 index a409f3b04dc..00000000000 --- a/vendor/github.com/Sirupsen/logrus/hooks/sentry/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# Sentry Hook for Logrus :walrus: - -[Sentry](https://getsentry.com) provides both self-hosted and hosted -solutions for exception tracking. -Both client and server are -[open source](https://github.com/getsentry/sentry). - -## Usage - -Every sentry application defined on the server gets a different -[DSN](https://www.getsentry.com/docs/). In the example below replace -`YOUR_DSN` with the one created for your application. - -```go -import ( - "github.com/Sirupsen/logrus" - "github.com/Sirupsen/logrus/hooks/sentry" -) - -func main() { - log := logrus.New() - hook, err := logrus_sentry.NewSentryHook(YOUR_DSN, []logrus.Level{ - logrus.PanicLevel, - logrus.FatalLevel, - logrus.ErrorLevel, - }) - - if err == nil { - log.Hooks.Add(hook) - } -} -``` - -## Special fields - -Some logrus fields have a special meaning in this hook, -these are server_name and logger. -When logs are sent to sentry these fields are treated differently. -- server_name (also known as hostname) is the name of the server which -is logging the event (hostname.example.com) -- logger is the part of the application which is logging the event. -In go this usually means setting it to the name of the package. - -## Timeout - -`Timeout` is the time the sentry hook will wait for a response -from the sentry server. - -If this time elapses with no response from -the server an error will be returned. - -If `Timeout` is set to 0 the SentryHook will not wait for a reply -and will assume a correct delivery. - -The SentryHook has a default timeout of `100 milliseconds` when created -with a call to `NewSentryHook`. This can be changed by assigning a value to the `Timeout` field: - -```go -hook, _ := logrus_sentry.NewSentryHook(...) -hook.Timeout = 20*time.Seconds -``` diff --git a/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go b/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go deleted file mode 100644 index 379f281c533..00000000000 --- a/vendor/github.com/Sirupsen/logrus/hooks/sentry/sentry.go +++ /dev/null @@ -1,100 +0,0 @@ -package logrus_sentry - -import ( - "fmt" - "time" - - "github.com/Sirupsen/logrus" - "github.com/getsentry/raven-go" -) - -var ( - severityMap = map[logrus.Level]raven.Severity{ - logrus.DebugLevel: raven.DEBUG, - logrus.InfoLevel: raven.INFO, - logrus.WarnLevel: raven.WARNING, - logrus.ErrorLevel: raven.ERROR, - logrus.FatalLevel: raven.FATAL, - logrus.PanicLevel: raven.FATAL, - } -) - -func getAndDel(d logrus.Fields, key string) (string, bool) { - var ( - ok bool - v interface{} - val string - ) - if v, ok = d[key]; !ok { - return "", false - } - - if val, ok = v.(string); !ok { - return "", false - } - delete(d, key) - return val, true -} - -// SentryHook delivers logs to a sentry server. -type SentryHook struct { - // Timeout sets the time to wait for a delivery error from the sentry server. - // If this is set to zero the server will not wait for any response and will - // consider the message correctly sent - Timeout time.Duration - - client *raven.Client - levels []logrus.Level -} - -// NewSentryHook creates a hook to be added to an instance of logger -// and initializes the raven client. -// This method sets the timeout to 100 milliseconds. -func NewSentryHook(DSN string, levels []logrus.Level) (*SentryHook, error) { - client, err := raven.NewClient(DSN, nil) - if err != nil { - return nil, err - } - return &SentryHook{100 * time.Millisecond, client, levels}, nil -} - -// Called when an event should be sent to sentry -// Special fields that sentry uses to give more information to the server -// are extracted from entry.Data (if they are found) -// These fields are: logger and server_name -func (hook *SentryHook) Fire(entry *logrus.Entry) error { - packet := &raven.Packet{ - Message: entry.Message, - Timestamp: raven.Timestamp(entry.Time), - Level: severityMap[entry.Level], - Platform: "go", - } - - d := entry.Data - - if logger, ok := getAndDel(d, "logger"); ok { - packet.Logger = logger - } - if serverName, ok := getAndDel(d, "server_name"); ok { - packet.ServerName = serverName - } - packet.Extra = map[string]interface{}(d) - - _, errCh := hook.client.Capture(packet, nil) - timeout := hook.Timeout - if timeout != 0 { - timeoutCh := time.After(timeout) - select { - case err := <-errCh: - return err - case <-timeoutCh: - return fmt.Errorf("no response from sentry server in %s", timeout) - } - } - return nil -} - -// Levels returns the available logging levels. -func (hook *SentryHook) Levels() []logrus.Level { - return hook.levels -} diff --git a/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md b/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md deleted file mode 100644 index 4dbb8e72907..00000000000 --- a/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Syslog Hooks for Logrus :walrus: - -## Usage - -```go -import ( - "log/syslog" - "github.com/Sirupsen/logrus" - logrus_syslog "github.com/Sirupsen/logrus/hooks/syslog" -) - -func main() { - log := logrus.New() - hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") - - if err == nil { - log.Hooks.Add(hook) - } -} -``` diff --git a/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go b/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go deleted file mode 100644 index b6fa3746280..00000000000 --- a/vendor/github.com/Sirupsen/logrus/hooks/syslog/syslog.go +++ /dev/null @@ -1,59 +0,0 @@ -package logrus_syslog - -import ( - "fmt" - "github.com/Sirupsen/logrus" - "log/syslog" - "os" -) - -// SyslogHook to send logs via syslog. -type SyslogHook struct { - Writer *syslog.Writer - SyslogNetwork string - SyslogRaddr string -} - -// Creates a hook to be added to an instance of logger. This is called with -// `hook, err := NewSyslogHook("udp", "localhost:514", syslog.LOG_DEBUG, "")` -// `if err == nil { log.Hooks.Add(hook) }` -func NewSyslogHook(network, raddr string, priority syslog.Priority, tag string) (*SyslogHook, error) { - w, err := syslog.Dial(network, raddr, priority, tag) - return &SyslogHook{w, network, raddr}, err -} - -func (hook *SyslogHook) Fire(entry *logrus.Entry) error { - line, err := entry.String() - if err != nil { - fmt.Fprintf(os.Stderr, "Unable to read entry, %v", err) - return err - } - - switch entry.Level { - case logrus.PanicLevel: - return hook.Writer.Crit(line) - case logrus.FatalLevel: - return hook.Writer.Crit(line) - case logrus.ErrorLevel: - return hook.Writer.Err(line) - case logrus.WarnLevel: - return hook.Writer.Warning(line) - case logrus.InfoLevel: - return hook.Writer.Info(line) - case logrus.DebugLevel: - return hook.Writer.Debug(line) - default: - return nil - } -} - -func (hook *SyslogHook) Levels() []logrus.Level { - return []logrus.Level{ - logrus.PanicLevel, - logrus.FatalLevel, - logrus.ErrorLevel, - logrus.WarnLevel, - logrus.InfoLevel, - logrus.DebugLevel, - } -} diff --git a/vendor/github.com/abbot/go-http-auth/examples/basic.go b/vendor/github.com/abbot/go-http-auth/examples/basic.go deleted file mode 100644 index 49d3989dafc..00000000000 --- a/vendor/github.com/abbot/go-http-auth/examples/basic.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build ignore - -/* - Example application using Basic auth - - Build with: - - go build basic.go -*/ - -package main - -import ( - auth ".." - "fmt" - "net/http" -) - -func Secret(user, realm string) string { - if user == "john" { - // password is "hello" - return "$1$dlPL2MqE$oQmn16q49SqdmhenQuNgs1" - } - return "" -} - -func handle(w http.ResponseWriter, r *auth.AuthenticatedRequest) { - fmt.Fprintf(w, "

Hello, %s!

", r.Username) -} - -func main() { - authenticator := auth.NewBasicAuthenticator("example.com", Secret) - http.HandleFunc("/", authenticator.Wrap(handle)) - http.ListenAndServe(":8080", nil) -} diff --git a/vendor/github.com/abbot/go-http-auth/examples/digest.go b/vendor/github.com/abbot/go-http-auth/examples/digest.go deleted file mode 100644 index 38598933887..00000000000 --- a/vendor/github.com/abbot/go-http-auth/examples/digest.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build ignore - -/* - Example application using Digest auth - - Build with: - - go build digest.go -*/ - -package main - -import ( - auth ".." - "fmt" - "net/http" -) - -func Secret(user, realm string) string { - if user == "john" { - // password is "hello" - return "b98e16cbc3d01734b264adba7baa3bf9" - } - return "" -} - -func handle(w http.ResponseWriter, r *auth.AuthenticatedRequest) { - fmt.Fprintf(w, "

Hello, %s!

", r.Username) -} - -func main() { - authenticator := auth.NewDigestAuthenticator("example.com", Secret) - http.HandleFunc("/", authenticator.Wrap(handle)) - http.ListenAndServe(":8080", nil) -} diff --git a/vendor/github.com/abbot/go-http-auth/examples/wrapped.go b/vendor/github.com/abbot/go-http-auth/examples/wrapped.go deleted file mode 100644 index aa95ec38f27..00000000000 --- a/vendor/github.com/abbot/go-http-auth/examples/wrapped.go +++ /dev/null @@ -1,36 +0,0 @@ -// +build ignore - -/* - Example demonstrating how to wrap an application which is unaware of - authenticated requests with a "pass-through" authentication - - Build with: - - go build wrapped.go -*/ - -package main - -import ( - auth ".." - "fmt" - "net/http" -) - -func Secret(user, realm string) string { - if user == "john" { - // password is "hello" - return "$1$dlPL2MqE$oQmn16q49SqdmhenQuNgs1" - } - return "" -} - -func regular_handler(w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "

This application is unaware of authentication

") -} - -func main() { - authenticator := auth.NewBasicAuthenticator("example.com", Secret) - http.HandleFunc("/", auth.JustCheck(authenticator, regular_handler)) - http.ListenAndServe(":8080", nil) -} diff --git a/vendor/github.com/appc/cni/Godeps/_workspace/src/github.com/d2g/dhcp4/LICENSE b/vendor/github.com/appc/cni/Godeps/_workspace/src/github.com/d2g/dhcp4/LICENSE deleted file mode 100644 index f7d058a3586..00000000000 --- a/vendor/github.com/appc/cni/Godeps/_workspace/src/github.com/d2g/dhcp4/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 Skagerrak Software Limited. 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 Skagerrak Software Limited 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. \ No newline at end of file diff --git a/vendor/github.com/appc/cni/Godeps/_workspace/src/github.com/d2g/dhcp4client/LICENSE b/vendor/github.com/appc/cni/Godeps/_workspace/src/github.com/d2g/dhcp4client/LICENSE deleted file mode 100644 index c33dcc7c928..00000000000 --- a/vendor/github.com/appc/cni/Godeps/_workspace/src/github.com/d2g/dhcp4client/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. “Contributor” - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. “Contributor Version” - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - - means Covered Software of a particular Contributor. - -1.4. “Covered Software” - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. “Incompatible With Secondary Licenses” - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. “Executable Form” - - means any form of the work other than Source Code Form. - -1.7. “Larger Work” - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. “License” - - means this document. - -1.9. “Licensable” - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. “Modifications” - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. “Secondary License” - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - - means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, “control” means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipients’ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - party’s negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/appc/cni/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE b/vendor/github.com/appc/cni/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE deleted file mode 100644 index 9f64db8582c..00000000000 --- a/vendor/github.com/appc/cni/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE +++ /dev/null @@ -1,192 +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 2014 Vishvananda Ishaya. - Copyright 2014 Docker, Inc. - - 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/appc/spec/Godeps/_workspace/src/github.com/camlistore/go4/LICENSE b/vendor/github.com/appc/spec/Godeps/_workspace/src/github.com/camlistore/go4/LICENSE deleted file mode 100644 index 8f71f43fee3..00000000000 --- a/vendor/github.com/appc/spec/Godeps/_workspace/src/github.com/camlistore/go4/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/appc/spec/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE b/vendor/github.com/appc/spec/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE deleted file mode 100644 index 63ed1cfea1f..00000000000 --- a/vendor/github.com/appc/spec/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/appc/spec/Godeps/_workspace/src/go4.org/LICENSE b/vendor/github.com/appc/spec/Godeps/_workspace/src/go4.org/LICENSE deleted file mode 100644 index 8f71f43fee3..00000000000 --- a/vendor/github.com/appc/spec/Godeps/_workspace/src/go4.org/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/appc/spec/Godeps/_workspace/src/golang.org/x/net/LICENSE b/vendor/github.com/appc/spec/Godeps/_workspace/src/golang.org/x/net/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/appc/spec/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/appc/spec/Godeps/_workspace/src/golang.org/x/net/PATENTS b/vendor/github.com/appc/spec/Godeps/_workspace/src/golang.org/x/net/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/github.com/appc/spec/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/appc/spec/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf/LICENSE b/vendor/github.com/appc/spec/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf/LICENSE deleted file mode 100644 index efa1aa1896a..00000000000 --- a/vendor/github.com/appc/spec/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf/LICENSE +++ /dev/null @@ -1,57 +0,0 @@ -Copyright (c) 2012 Péter Surányi. 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. - -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. - ----------------------------------------------------------------------- -Portions of inf.Dec's source code have been derived from Go and are -covered by the following license: ----------------------------------------------------------------------- - -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/appc/spec/schema/lastditch/doc.go b/vendor/github.com/appc/spec/schema/lastditch/doc.go deleted file mode 100644 index 9cc5734607d..00000000000 --- a/vendor/github.com/appc/spec/schema/lastditch/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2015 The appc 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. - -// Package lastditch provides fallback redefinitions of parts of -// schemas provided by schema package. -// -// Almost no validation of schemas is done (besides checking if data -// really is `JSON`-encoded and kind is either `ImageManifest` or -// `PodManifest`. This is to get as much data as possible from an -// invalid manifest. The main aim of the package is to be used for the -// better error reporting. The another aim might be to force some -// operation (like removing a pod), which would otherwise fail because -// of an invalid manifest. -// -// To avoid validation during deserialization, types provided by this -// package use plain strings. -package lastditch diff --git a/vendor/github.com/appc/spec/schema/lastditch/image.go b/vendor/github.com/appc/spec/schema/lastditch/image.go deleted file mode 100644 index dc5055a0564..00000000000 --- a/vendor/github.com/appc/spec/schema/lastditch/image.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2015 The appc 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. - -package lastditch - -import ( - "encoding/json" - - "github.com/appc/spec/schema" - "github.com/appc/spec/schema/types" -) - -type ImageManifest struct { - ACVersion string `json:"acVersion"` - ACKind string `json:"acKind"` - Name string `json:"name"` - Labels Labels `json:"labels,omitempty"` -} - -// a type just to avoid a recursion during unmarshalling -type imageManifest ImageManifest - -func (im *ImageManifest) UnmarshalJSON(data []byte) error { - i := imageManifest(*im) - err := json.Unmarshal(data, &i) - if err != nil { - return err - } - if i.ACKind != string(schema.ImageManifestKind) { - return types.InvalidACKindError(schema.ImageManifestKind) - } - *im = ImageManifest(i) - return nil -} diff --git a/vendor/github.com/appc/spec/schema/lastditch/labels.go b/vendor/github.com/appc/spec/schema/lastditch/labels.go deleted file mode 100644 index 5cf93a087c4..00000000000 --- a/vendor/github.com/appc/spec/schema/lastditch/labels.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015 The appc 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. - -package lastditch - -import ( - "encoding/json" -) - -type Labels []Label - -// a type just to avoid a recursion during unmarshalling -type labels Labels - -type Label struct { - Name string `json:"name"` - Value string `json:"value"` -} - -func (l *Labels) UnmarshalJSON(data []byte) error { - var jl labels - if err := json.Unmarshal(data, &jl); err != nil { - return err - } - *l = Labels(jl) - return nil -} diff --git a/vendor/github.com/appc/spec/schema/lastditch/pod.go b/vendor/github.com/appc/spec/schema/lastditch/pod.go deleted file mode 100644 index 2e9d8456bbd..00000000000 --- a/vendor/github.com/appc/spec/schema/lastditch/pod.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2015 The appc 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. - -package lastditch - -import ( - "encoding/json" - - "github.com/appc/spec/schema" - "github.com/appc/spec/schema/types" -) - -type PodManifest struct { - ACVersion string `json:"acVersion"` - ACKind string `json:"acKind"` - Apps AppList `json:"apps"` -} - -type AppList []RuntimeApp - -type RuntimeApp struct { - Name string `json:"name"` - Image RuntimeImage `json:"image"` -} - -type RuntimeImage struct { - Name string `json:"name"` - ID string `json:"id"` - Labels Labels `json:"labels,omitempty"` -} - -// a type just to avoid a recursion during unmarshalling -type podManifest PodManifest - -func (pm *PodManifest) UnmarshalJSON(data []byte) error { - p := podManifest(*pm) - err := json.Unmarshal(data, &p) - if err != nil { - return err - } - if p.ACKind != string(schema.PodManifestKind) { - return types.InvalidACKindError(schema.PodManifestKind) - } - *pm = PodManifest(p) - return nil -} diff --git a/vendor/github.com/armon/go-metrics/datadog/dogstatsd.go b/vendor/github.com/armon/go-metrics/datadog/dogstatsd.go deleted file mode 100644 index aaba9fe0e22..00000000000 --- a/vendor/github.com/armon/go-metrics/datadog/dogstatsd.go +++ /dev/null @@ -1,125 +0,0 @@ -package datadog - -import ( - "fmt" - "strings" - - "github.com/DataDog/datadog-go/statsd" -) - -// DogStatsdSink provides a MetricSink that can be used -// with a dogstatsd server. It utilizes the Dogstatsd client at github.com/DataDog/datadog-go/statsd -type DogStatsdSink struct { - client *statsd.Client - hostName string - propagateHostname bool -} - -// NewDogStatsdSink is used to create a new DogStatsdSink with sane defaults -func NewDogStatsdSink(addr string, hostName string) (*DogStatsdSink, error) { - client, err := statsd.New(addr) - if err != nil { - return nil, err - } - sink := &DogStatsdSink{ - client: client, - hostName: hostName, - propagateHostname: false, - } - return sink, nil -} - -// SetTags sets common tags on the Dogstatsd Client that will be sent -// along with all dogstatsd packets. -// Ref: http://docs.datadoghq.com/guides/dogstatsd/#tags -func (s *DogStatsdSink) SetTags(tags []string) { - s.client.Tags = tags -} - -// EnableHostnamePropagation forces a Dogstatsd `host` tag with the value specified by `s.HostName` -// Since the go-metrics package has its own mechanism for attaching a hostname to metrics, -// setting the `propagateHostname` flag ensures that `s.HostName` overrides the host tag naively set by the DogStatsd server -func (s *DogStatsdSink) EnableHostNamePropagation() { - s.propagateHostname = true -} - -func (s *DogStatsdSink) flattenKey(parts []string) string { - joined := strings.Join(parts, ".") - return strings.Map(func(r rune) rune { - switch r { - case ':': - fallthrough - case ' ': - return '_' - default: - return r - } - }, joined) -} - -func (s *DogStatsdSink) parseKey(key []string) ([]string, []string) { - // Since DogStatsd supports dimensionality via tags on metric keys, this sink's approach is to splice the hostname out of the key in favor of a `host` tag - // The `host` tag is either forced here, or set downstream by the DogStatsd server - - var tags []string - hostName := s.hostName - - //Splice the hostname out of the key - for i, el := range key { - if el == hostName { - key = append(key[:i], key[i+1:]...) - } - } - - if s.propagateHostname { - tags = append(tags, fmt.Sprintf("host:%s", hostName)) - } - return key, tags -} - -// Implementation of methods in the MetricSink interface - -func (s *DogStatsdSink) SetGauge(key []string, val float32) { - s.SetGaugeWithTags(key, val, []string{}) -} - -func (s *DogStatsdSink) IncrCounter(key []string, val float32) { - s.IncrCounterWithTags(key, val, []string{}) -} - -// EmitKey is not implemented since DogStatsd does not provide a metric type that holds an -// arbitrary number of values -func (s *DogStatsdSink) EmitKey(key []string, val float32) { -} - -func (s *DogStatsdSink) AddSample(key []string, val float32) { - s.AddSampleWithTags(key, val, []string{}) -} - -// The following ...WithTags methods correspond to Datadog's Tag extension to Statsd. -// http://docs.datadoghq.com/guides/dogstatsd/#tags - -func (s *DogStatsdSink) SetGaugeWithTags(key []string, val float32, tags []string) { - flatKey, tags := s.getFlatkeyAndCombinedTags(key, tags) - rate := 1.0 - s.client.Gauge(flatKey, float64(val), tags, rate) -} - -func (s *DogStatsdSink) IncrCounterWithTags(key []string, val float32, tags []string) { - flatKey, tags := s.getFlatkeyAndCombinedTags(key, tags) - rate := 1.0 - s.client.Count(flatKey, int64(val), tags, rate) -} - -func (s *DogStatsdSink) AddSampleWithTags(key []string, val float32, tags []string) { - flatKey, tags := s.getFlatkeyAndCombinedTags(key, tags) - rate := 1.0 - s.client.TimeInMilliseconds(flatKey, float64(val), tags, rate) -} - -func (s *DogStatsdSink) getFlatkeyAndCombinedTags(key []string, tags []string) (flattenedKey string, combinedTags []string) { - key, hostTags := s.parseKey(key) - flatKey := s.flattenKey(key) - tags = append(tags, hostTags...) - return flatKey, tags -} diff --git a/vendor/github.com/armon/go-metrics/prometheus/prometheus.go b/vendor/github.com/armon/go-metrics/prometheus/prometheus.go deleted file mode 100644 index 362dbfb623d..00000000000 --- a/vendor/github.com/armon/go-metrics/prometheus/prometheus.go +++ /dev/null @@ -1,88 +0,0 @@ -// +build go1.3 -package prometheus - -import ( - "strings" - "sync" - "time" - - "github.com/prometheus/client_golang/prometheus" -) - -type PrometheusSink struct { - mu sync.Mutex - gauges map[string]prometheus.Gauge - summaries map[string]prometheus.Summary - counters map[string]prometheus.Counter -} - -func NewPrometheusSink() (*PrometheusSink, error) { - return &PrometheusSink{ - gauges: make(map[string]prometheus.Gauge), - summaries: make(map[string]prometheus.Summary), - counters: make(map[string]prometheus.Counter), - }, nil -} - -func (p *PrometheusSink) flattenKey(parts []string) string { - joined := strings.Join(parts, "_") - joined = strings.Replace(joined, " ", "_", -1) - joined = strings.Replace(joined, ".", "_", -1) - joined = strings.Replace(joined, "-", "_", -1) - return joined -} - -func (p *PrometheusSink) SetGauge(parts []string, val float32) { - p.mu.Lock() - defer p.mu.Unlock() - key := p.flattenKey(parts) - g, ok := p.gauges[key] - if !ok { - g = prometheus.NewGauge(prometheus.GaugeOpts{ - Name: key, - Help: key, - }) - prometheus.MustRegister(g) - p.gauges[key] = g - } - g.Set(float64(val)) -} - -func (p *PrometheusSink) AddSample(parts []string, val float32) { - p.mu.Lock() - defer p.mu.Unlock() - key := p.flattenKey(parts) - g, ok := p.summaries[key] - if !ok { - g = prometheus.NewSummary(prometheus.SummaryOpts{ - Name: key, - Help: key, - MaxAge: 10 * time.Second, - }) - prometheus.MustRegister(g) - p.summaries[key] = g - } - g.Observe(float64(val)) -} - -// EmitKey is not implemented. Prometheus doesn’t offer a type for which an -// arbitrary number of values is retained, as Prometheus works with a pull -// model, rather than a push model. -func (p *PrometheusSink) EmitKey(key []string, val float32) { -} - -func (p *PrometheusSink) IncrCounter(parts []string, val float32) { - p.mu.Lock() - defer p.mu.Unlock() - key := p.flattenKey(parts) - g, ok := p.counters[key] - if !ok { - g = prometheus.NewCounter(prometheus.CounterOpts{ - Name: key, - Help: key, - }) - prometheus.MustRegister(g) - p.counters[key] = g - } - g.Add(float64(val)) -} 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 0214860d4cc..00000000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ /dev/null @@ -1,130 +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" -) - -// 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{}, 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, - }, 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 5f9ed8e60be..00000000000 --- 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/ec2/ec2iface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go deleted file mode 100644 index 42165fd29f1..00000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go +++ /dev/null @@ -1,804 +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) - - 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) - - 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) - - 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) - - 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) - - 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) - - 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 f98fda64751..00000000000 --- 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/elb/elbiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go deleted file mode 100644 index 5674133f71e..00000000000 --- 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/blang/semver/examples/main.go b/vendor/github.com/blang/semver/examples/main.go deleted file mode 100644 index f36c983d90f..00000000000 --- a/vendor/github.com/blang/semver/examples/main.go +++ /dev/null @@ -1,83 +0,0 @@ -package main - -import ( - "fmt" - "github.com/blang/semver" -) - -func main() { - v, err := semver.Parse("0.0.1-alpha.preview.222+123.github") - if err != nil { - fmt.Printf("Error while parsing (not valid): %q", err) - } - fmt.Printf("Version to string: %q\n", v) - - fmt.Printf("Major: %d\n", v.Major) - fmt.Printf("Minor: %d\n", v.Minor) - fmt.Printf("Patch: %d\n", v.Patch) - - // Prerelease versions - if len(v.Pre) > 0 { - fmt.Println("Prerelease versions:") - for i, pre := range v.Pre { - fmt.Printf("%d: %q\n", i, pre) - } - } - - // Build meta data - if len(v.Build) > 0 { - fmt.Println("Build meta data:") - for i, build := range v.Build { - fmt.Printf("%d: %q\n", i, build) - } - } - - // Make == Parse (Value), New for Pointer - v001, err := semver.Make("0.0.1") - - fmt.Println("\nUse Version.Compare for comparisons (-1, 0, 1):") - fmt.Printf("%q is greater than %q: Compare == %d\n", v001, v, v001.Compare(v)) - fmt.Printf("%q is less than %q: Compare == %d\n", v, v001, v.Compare(v001)) - fmt.Printf("%q is equal to %q: Compare == %d\n", v, v, v.Compare(v)) - - fmt.Println("\nUse comparison helpers returning booleans:") - fmt.Printf("%q is greater than %q: %t\n", v001, v, v001.GT(v)) - fmt.Printf("%q is greater than equal %q: %t\n", v001, v, v001.GTE(v)) - fmt.Printf("%q is greater than equal %q: %t\n", v, v, v.GTE(v)) - fmt.Printf("%q is less than %q: %t\n", v, v001, v.LT(v001)) - fmt.Printf("%q is less than equal %q: %t\n", v, v001, v.LTE(v001)) - fmt.Printf("%q is less than equal %q: %t\n", v, v, v.LTE(v)) - - fmt.Println("\nManipulate Version in place:") - v.Pre[0], err = semver.NewPRVersion("beta") - if err != nil { - fmt.Printf("Error parsing pre release version: %q", err) - } - fmt.Printf("Version to string: %q\n", v) - - fmt.Println("\nCompare Prerelease versions:") - pre1, _ := semver.NewPRVersion("123") - pre2, _ := semver.NewPRVersion("alpha") - pre3, _ := semver.NewPRVersion("124") - fmt.Printf("%q is less than %q: Compare == %d\n", pre1, pre2, pre1.Compare(pre2)) - fmt.Printf("%q is greater than %q: Compare == %d\n", pre3, pre1, pre3.Compare(pre1)) - fmt.Printf("%q is equal to %q: Compare == %d\n", pre1, pre1, pre1.Compare(pre1)) - - fmt.Println("\nValidate versions:") - v.Build[0] = "?" - - err = v.Validate() - if err != nil { - fmt.Printf("Validation failed: %s\n", err) - } - - fmt.Println("Create valid build meta data:") - b1, _ := semver.NewBuildVersion("build123") - v.Build[0] = b1 - fmt.Printf("Version with new build version %q\n", v) - - _, err = semver.NewBuildVersion("build?123") - if err != nil { - fmt.Printf("Create build version failed: %s\n", err) - } -} diff --git a/vendor/github.com/boltdb/bolt/cmd/bolt/main.go b/vendor/github.com/boltdb/bolt/cmd/bolt/main.go deleted file mode 100644 index b96e6f73511..00000000000 --- a/vendor/github.com/boltdb/bolt/cmd/bolt/main.go +++ /dev/null @@ -1,1532 +0,0 @@ -package main - -import ( - "bytes" - "encoding/binary" - "errors" - "flag" - "fmt" - "io" - "io/ioutil" - "math/rand" - "os" - "runtime" - "runtime/pprof" - "strconv" - "strings" - "time" - "unicode" - "unicode/utf8" - "unsafe" - - "github.com/boltdb/bolt" -) - -var ( - // ErrUsage is returned when a usage message was printed and the process - // should simply exit with an error. - ErrUsage = errors.New("usage") - - // ErrUnknownCommand is returned when a CLI command is not specified. - ErrUnknownCommand = errors.New("unknown command") - - // ErrPathRequired is returned when the path to a Bolt database is not specified. - ErrPathRequired = errors.New("path required") - - // ErrFileNotFound is returned when a Bolt database does not exist. - ErrFileNotFound = errors.New("file not found") - - // ErrInvalidValue is returned when a benchmark reads an unexpected value. - ErrInvalidValue = errors.New("invalid value") - - // ErrCorrupt is returned when a checking a data file finds errors. - ErrCorrupt = errors.New("invalid value") - - // ErrNonDivisibleBatchSize is returned when the batch size can't be evenly - // divided by the iteration count. - ErrNonDivisibleBatchSize = errors.New("number of iterations must be divisible by the batch size") - - // ErrPageIDRequired is returned when a required page id is not specified. - ErrPageIDRequired = errors.New("page id required") - - // ErrPageNotFound is returned when specifying a page above the high water mark. - ErrPageNotFound = errors.New("page not found") - - // ErrPageFreed is returned when reading a page that has already been freed. - ErrPageFreed = errors.New("page freed") -) - -// PageHeaderSize represents the size of the bolt.page header. -const PageHeaderSize = 16 - -func main() { - m := NewMain() - if err := m.Run(os.Args[1:]...); err == ErrUsage { - os.Exit(2) - } else if err != nil { - fmt.Println(err.Error()) - os.Exit(1) - } -} - -// Main represents the main program execution. -type Main struct { - Stdin io.Reader - Stdout io.Writer - Stderr io.Writer -} - -// NewMain returns a new instance of Main connect to the standard input/output. -func NewMain() *Main { - return &Main{ - Stdin: os.Stdin, - Stdout: os.Stdout, - Stderr: os.Stderr, - } -} - -// Run executes the program. -func (m *Main) Run(args ...string) error { - // Require a command at the beginning. - if len(args) == 0 || strings.HasPrefix(args[0], "-") { - fmt.Fprintln(m.Stderr, m.Usage()) - return ErrUsage - } - - // Execute command. - switch args[0] { - case "help": - fmt.Fprintln(m.Stderr, m.Usage()) - return ErrUsage - case "bench": - return newBenchCommand(m).Run(args[1:]...) - case "check": - return newCheckCommand(m).Run(args[1:]...) - case "dump": - return newDumpCommand(m).Run(args[1:]...) - case "info": - return newInfoCommand(m).Run(args[1:]...) - case "page": - return newPageCommand(m).Run(args[1:]...) - case "pages": - return newPagesCommand(m).Run(args[1:]...) - case "stats": - return newStatsCommand(m).Run(args[1:]...) - default: - return ErrUnknownCommand - } -} - -// Usage returns the help message. -func (m *Main) Usage() string { - return strings.TrimLeft(` -Bolt is a tool for inspecting bolt databases. - -Usage: - - bolt command [arguments] - -The commands are: - - bench run synthetic benchmark against bolt - check verifies integrity of bolt database - info print basic info - help print this screen - pages print list of pages with their types - stats iterate over all pages and generate usage stats - -Use "bolt [command] -h" for more information about a command. -`, "\n") -} - -// CheckCommand represents the "check" command execution. -type CheckCommand struct { - Stdin io.Reader - Stdout io.Writer - Stderr io.Writer -} - -// NewCheckCommand returns a CheckCommand. -func newCheckCommand(m *Main) *CheckCommand { - return &CheckCommand{ - Stdin: m.Stdin, - Stdout: m.Stdout, - Stderr: m.Stderr, - } -} - -// Run executes the command. -func (cmd *CheckCommand) Run(args ...string) error { - // Parse flags. - fs := flag.NewFlagSet("", flag.ContinueOnError) - help := fs.Bool("h", false, "") - if err := fs.Parse(args); err != nil { - return err - } else if *help { - fmt.Fprintln(cmd.Stderr, cmd.Usage()) - return ErrUsage - } - - // Require database path. - path := fs.Arg(0) - if path == "" { - return ErrPathRequired - } else if _, err := os.Stat(path); os.IsNotExist(err) { - return ErrFileNotFound - } - - // Open database. - db, err := bolt.Open(path, 0666, nil) - if err != nil { - return err - } - defer db.Close() - - // Perform consistency check. - return db.View(func(tx *bolt.Tx) error { - var count int - ch := tx.Check() - loop: - for { - select { - case err, ok := <-ch: - if !ok { - break loop - } - fmt.Fprintln(cmd.Stdout, err) - count++ - } - } - - // Print summary of errors. - if count > 0 { - fmt.Fprintf(cmd.Stdout, "%d errors found\n", count) - return ErrCorrupt - } - - // Notify user that database is valid. - fmt.Fprintln(cmd.Stdout, "OK") - return nil - }) -} - -// Usage returns the help message. -func (cmd *CheckCommand) Usage() string { - return strings.TrimLeft(` -usage: bolt check PATH - -Check opens a database at PATH and runs an exhaustive check to verify that -all pages are accessible or are marked as freed. It also verifies that no -pages are double referenced. - -Verification errors will stream out as they are found and the process will -return after all pages have been checked. -`, "\n") -} - -// InfoCommand represents the "info" command execution. -type InfoCommand struct { - Stdin io.Reader - Stdout io.Writer - Stderr io.Writer -} - -// NewInfoCommand returns a InfoCommand. -func newInfoCommand(m *Main) *InfoCommand { - return &InfoCommand{ - Stdin: m.Stdin, - Stdout: m.Stdout, - Stderr: m.Stderr, - } -} - -// Run executes the command. -func (cmd *InfoCommand) Run(args ...string) error { - // Parse flags. - fs := flag.NewFlagSet("", flag.ContinueOnError) - help := fs.Bool("h", false, "") - if err := fs.Parse(args); err != nil { - return err - } else if *help { - fmt.Fprintln(cmd.Stderr, cmd.Usage()) - return ErrUsage - } - - // Require database path. - path := fs.Arg(0) - if path == "" { - return ErrPathRequired - } else if _, err := os.Stat(path); os.IsNotExist(err) { - return ErrFileNotFound - } - - // Open the database. - db, err := bolt.Open(path, 0666, nil) - if err != nil { - return err - } - defer db.Close() - - // Print basic database info. - info := db.Info() - fmt.Fprintf(cmd.Stdout, "Page Size: %d\n", info.PageSize) - - return nil -} - -// Usage returns the help message. -func (cmd *InfoCommand) Usage() string { - return strings.TrimLeft(` -usage: bolt info PATH - -Info prints basic information about the Bolt database at PATH. -`, "\n") -} - -// DumpCommand represents the "dump" command execution. -type DumpCommand struct { - Stdin io.Reader - Stdout io.Writer - Stderr io.Writer -} - -// newDumpCommand returns a DumpCommand. -func newDumpCommand(m *Main) *DumpCommand { - return &DumpCommand{ - Stdin: m.Stdin, - Stdout: m.Stdout, - Stderr: m.Stderr, - } -} - -// Run executes the command. -func (cmd *DumpCommand) Run(args ...string) error { - // Parse flags. - fs := flag.NewFlagSet("", flag.ContinueOnError) - help := fs.Bool("h", false, "") - if err := fs.Parse(args); err != nil { - return err - } else if *help { - fmt.Fprintln(cmd.Stderr, cmd.Usage()) - return ErrUsage - } - - // Require database path and page id. - path := fs.Arg(0) - if path == "" { - return ErrPathRequired - } else if _, err := os.Stat(path); os.IsNotExist(err) { - return ErrFileNotFound - } - - // Read page ids. - pageIDs, err := atois(fs.Args()[1:]) - if err != nil { - return err - } else if len(pageIDs) == 0 { - return ErrPageIDRequired - } - - // Open database to retrieve page size. - pageSize, err := ReadPageSize(path) - if err != nil { - return err - } - - // Open database file handler. - f, err := os.Open(path) - if err != nil { - return err - } - defer func() { _ = f.Close() }() - - // Print each page listed. - for i, pageID := range pageIDs { - // Print a separator. - if i > 0 { - fmt.Fprintln(cmd.Stdout, "===============================================") - } - - // Print page to stdout. - if err := cmd.PrintPage(cmd.Stdout, f, pageID, pageSize); err != nil { - return err - } - } - - return nil -} - -// PrintPage prints a given page as hexidecimal. -func (cmd *DumpCommand) PrintPage(w io.Writer, r io.ReaderAt, pageID int, pageSize int) error { - const bytesPerLineN = 16 - - // Read page into buffer. - buf := make([]byte, pageSize) - addr := pageID * pageSize - if n, err := r.ReadAt(buf, int64(addr)); err != nil { - return err - } else if n != pageSize { - return io.ErrUnexpectedEOF - } - - // Write out to writer in 16-byte lines. - var prev []byte - var skipped bool - for offset := 0; offset < pageSize; offset += bytesPerLineN { - // Retrieve current 16-byte line. - line := buf[offset : offset+bytesPerLineN] - isLastLine := (offset == (pageSize - bytesPerLineN)) - - // If it's the same as the previous line then print a skip. - if bytes.Equal(line, prev) && !isLastLine { - if !skipped { - fmt.Fprintf(w, "%07x *\n", addr+offset) - skipped = true - } - } else { - // Print line as hexadecimal in 2-byte groups. - fmt.Fprintf(w, "%07x %04x %04x %04x %04x %04x %04x %04x %04x\n", addr+offset, - line[0:2], line[2:4], line[4:6], line[6:8], - line[8:10], line[10:12], line[12:14], line[14:16], - ) - - skipped = false - } - - // Save the previous line. - prev = line - } - fmt.Fprint(w, "\n") - - return nil -} - -// Usage returns the help message. -func (cmd *DumpCommand) Usage() string { - return strings.TrimLeft(` -usage: bolt dump -page PAGEID PATH - -Dump prints a hexidecimal dump of a single page. -`, "\n") -} - -// PageCommand represents the "page" command execution. -type PageCommand struct { - Stdin io.Reader - Stdout io.Writer - Stderr io.Writer -} - -// newPageCommand returns a PageCommand. -func newPageCommand(m *Main) *PageCommand { - return &PageCommand{ - Stdin: m.Stdin, - Stdout: m.Stdout, - Stderr: m.Stderr, - } -} - -// Run executes the command. -func (cmd *PageCommand) Run(args ...string) error { - // Parse flags. - fs := flag.NewFlagSet("", flag.ContinueOnError) - help := fs.Bool("h", false, "") - if err := fs.Parse(args); err != nil { - return err - } else if *help { - fmt.Fprintln(cmd.Stderr, cmd.Usage()) - return ErrUsage - } - - // Require database path and page id. - path := fs.Arg(0) - if path == "" { - return ErrPathRequired - } else if _, err := os.Stat(path); os.IsNotExist(err) { - return ErrFileNotFound - } - - // Read page ids. - pageIDs, err := atois(fs.Args()[1:]) - if err != nil { - return err - } else if len(pageIDs) == 0 { - return ErrPageIDRequired - } - - // Open database file handler. - f, err := os.Open(path) - if err != nil { - return err - } - defer func() { _ = f.Close() }() - - // Print each page listed. - for i, pageID := range pageIDs { - // Print a separator. - if i > 0 { - fmt.Fprintln(cmd.Stdout, "===============================================") - } - - // Retrieve page info and page size. - p, buf, err := ReadPage(path, pageID) - if err != nil { - return err - } - - // Print basic page info. - fmt.Fprintf(cmd.Stdout, "Page ID: %d\n", p.id) - fmt.Fprintf(cmd.Stdout, "Page Type: %s\n", p.Type()) - fmt.Fprintf(cmd.Stdout, "Total Size: %d bytes\n", len(buf)) - - // Print type-specific data. - switch p.Type() { - case "meta": - err = cmd.PrintMeta(cmd.Stdout, buf) - case "leaf": - err = cmd.PrintLeaf(cmd.Stdout, buf) - case "branch": - err = cmd.PrintBranch(cmd.Stdout, buf) - case "freelist": - err = cmd.PrintFreelist(cmd.Stdout, buf) - } - if err != nil { - return err - } - } - - return nil -} - -// PrintMeta prints the data from the meta page. -func (cmd *PageCommand) PrintMeta(w io.Writer, buf []byte) error { - m := (*meta)(unsafe.Pointer(&buf[PageHeaderSize])) - fmt.Fprintf(w, "Version: %d\n", m.version) - fmt.Fprintf(w, "Page Size: %d bytes\n", m.pageSize) - fmt.Fprintf(w, "Flags: %08x\n", m.flags) - fmt.Fprintf(w, "Root: \n", m.root.root) - fmt.Fprintf(w, "Freelist: \n", m.freelist) - fmt.Fprintf(w, "HWM: \n", m.pgid) - fmt.Fprintf(w, "Txn ID: %d\n", m.txid) - fmt.Fprintf(w, "Checksum: %016x\n", m.checksum) - fmt.Fprintf(w, "\n") - return nil -} - -// PrintLeaf prints the data for a leaf page. -func (cmd *PageCommand) PrintLeaf(w io.Writer, buf []byte) error { - p := (*page)(unsafe.Pointer(&buf[0])) - - // Print number of items. - fmt.Fprintf(w, "Item Count: %d\n", p.count) - fmt.Fprintf(w, "\n") - - // Print each key/value. - for i := uint16(0); i < p.count; i++ { - e := p.leafPageElement(i) - - // Format key as string. - var k string - if isPrintable(string(e.key())) { - k = fmt.Sprintf("%q", string(e.key())) - } else { - k = fmt.Sprintf("%x", string(e.key())) - } - - // Format value as string. - var v string - if (e.flags & uint32(bucketLeafFlag)) != 0 { - b := (*bucket)(unsafe.Pointer(&e.value()[0])) - v = fmt.Sprintf("", b.root, b.sequence) - } else if isPrintable(string(e.value())) { - k = fmt.Sprintf("%q", string(e.value())) - } else { - k = fmt.Sprintf("%x", string(e.value())) - } - - fmt.Fprintf(w, "%s: %s\n", k, v) - } - fmt.Fprintf(w, "\n") - return nil -} - -// PrintBranch prints the data for a leaf page. -func (cmd *PageCommand) PrintBranch(w io.Writer, buf []byte) error { - p := (*page)(unsafe.Pointer(&buf[0])) - - // Print number of items. - fmt.Fprintf(w, "Item Count: %d\n", p.count) - fmt.Fprintf(w, "\n") - - // Print each key/value. - for i := uint16(0); i < p.count; i++ { - e := p.branchPageElement(i) - - // Format key as string. - var k string - if isPrintable(string(e.key())) { - k = fmt.Sprintf("%q", string(e.key())) - } else { - k = fmt.Sprintf("%x", string(e.key())) - } - - fmt.Fprintf(w, "%s: \n", k, e.pgid) - } - fmt.Fprintf(w, "\n") - return nil -} - -// PrintFreelist prints the data for a freelist page. -func (cmd *PageCommand) PrintFreelist(w io.Writer, buf []byte) error { - p := (*page)(unsafe.Pointer(&buf[0])) - - // Print number of items. - fmt.Fprintf(w, "Item Count: %d\n", p.count) - fmt.Fprintf(w, "\n") - - // Print each page in the freelist. - ids := (*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)) - for i := uint16(0); i < p.count; i++ { - fmt.Fprintf(w, "%d\n", ids[i]) - } - fmt.Fprintf(w, "\n") - return nil -} - -// PrintPage prints a given page as hexidecimal. -func (cmd *PageCommand) PrintPage(w io.Writer, r io.ReaderAt, pageID int, pageSize int) error { - const bytesPerLineN = 16 - - // Read page into buffer. - buf := make([]byte, pageSize) - addr := pageID * pageSize - if n, err := r.ReadAt(buf, int64(addr)); err != nil { - return err - } else if n != pageSize { - return io.ErrUnexpectedEOF - } - - // Write out to writer in 16-byte lines. - var prev []byte - var skipped bool - for offset := 0; offset < pageSize; offset += bytesPerLineN { - // Retrieve current 16-byte line. - line := buf[offset : offset+bytesPerLineN] - isLastLine := (offset == (pageSize - bytesPerLineN)) - - // If it's the same as the previous line then print a skip. - if bytes.Equal(line, prev) && !isLastLine { - if !skipped { - fmt.Fprintf(w, "%07x *\n", addr+offset) - skipped = true - } - } else { - // Print line as hexadecimal in 2-byte groups. - fmt.Fprintf(w, "%07x %04x %04x %04x %04x %04x %04x %04x %04x\n", addr+offset, - line[0:2], line[2:4], line[4:6], line[6:8], - line[8:10], line[10:12], line[12:14], line[14:16], - ) - - skipped = false - } - - // Save the previous line. - prev = line - } - fmt.Fprint(w, "\n") - - return nil -} - -// Usage returns the help message. -func (cmd *PageCommand) Usage() string { - return strings.TrimLeft(` -usage: bolt page -page PATH pageid [pageid...] - -Page prints one or more pages in human readable format. -`, "\n") -} - -// PagesCommand represents the "pages" command execution. -type PagesCommand struct { - Stdin io.Reader - Stdout io.Writer - Stderr io.Writer -} - -// NewPagesCommand returns a PagesCommand. -func newPagesCommand(m *Main) *PagesCommand { - return &PagesCommand{ - Stdin: m.Stdin, - Stdout: m.Stdout, - Stderr: m.Stderr, - } -} - -// Run executes the command. -func (cmd *PagesCommand) Run(args ...string) error { - // Parse flags. - fs := flag.NewFlagSet("", flag.ContinueOnError) - help := fs.Bool("h", false, "") - if err := fs.Parse(args); err != nil { - return err - } else if *help { - fmt.Fprintln(cmd.Stderr, cmd.Usage()) - return ErrUsage - } - - // Require database path. - path := fs.Arg(0) - if path == "" { - return ErrPathRequired - } else if _, err := os.Stat(path); os.IsNotExist(err) { - return ErrFileNotFound - } - - // Open database. - db, err := bolt.Open(path, 0666, nil) - if err != nil { - return err - } - defer func() { _ = db.Close() }() - - // Write header. - fmt.Fprintln(cmd.Stdout, "ID TYPE ITEMS OVRFLW") - fmt.Fprintln(cmd.Stdout, "======== ========== ====== ======") - - return db.Update(func(tx *bolt.Tx) error { - var id int - for { - p, err := tx.Page(id) - if err != nil { - return &PageError{ID: id, Err: err} - } else if p == nil { - break - } - - // Only display count and overflow if this is a non-free page. - var count, overflow string - if p.Type != "free" { - count = strconv.Itoa(p.Count) - if p.OverflowCount > 0 { - overflow = strconv.Itoa(p.OverflowCount) - } - } - - // Print table row. - fmt.Fprintf(cmd.Stdout, "%-8d %-10s %-6s %-6s\n", p.ID, p.Type, count, overflow) - - // Move to the next non-overflow page. - id += 1 - if p.Type != "free" { - id += p.OverflowCount - } - } - return nil - }) -} - -// Usage returns the help message. -func (cmd *PagesCommand) Usage() string { - return strings.TrimLeft(` -usage: bolt pages PATH - -Pages prints a table of pages with their type (meta, leaf, branch, freelist). -Leaf and branch pages will show a key count in the "items" column while the -freelist will show the number of free pages in the "items" column. - -The "overflow" column shows the number of blocks that the page spills over -into. Normally there is no overflow but large keys and values can cause -a single page to take up multiple blocks. -`, "\n") -} - -// StatsCommand represents the "stats" command execution. -type StatsCommand struct { - Stdin io.Reader - Stdout io.Writer - Stderr io.Writer -} - -// NewStatsCommand returns a StatsCommand. -func newStatsCommand(m *Main) *StatsCommand { - return &StatsCommand{ - Stdin: m.Stdin, - Stdout: m.Stdout, - Stderr: m.Stderr, - } -} - -// Run executes the command. -func (cmd *StatsCommand) Run(args ...string) error { - // Parse flags. - fs := flag.NewFlagSet("", flag.ContinueOnError) - help := fs.Bool("h", false, "") - if err := fs.Parse(args); err != nil { - return err - } else if *help { - fmt.Fprintln(cmd.Stderr, cmd.Usage()) - return ErrUsage - } - - // Require database path. - path, prefix := fs.Arg(0), fs.Arg(1) - if path == "" { - return ErrPathRequired - } else if _, err := os.Stat(path); os.IsNotExist(err) { - return ErrFileNotFound - } - - // Open database. - db, err := bolt.Open(path, 0666, nil) - if err != nil { - return err - } - defer db.Close() - - return db.View(func(tx *bolt.Tx) error { - var s bolt.BucketStats - var count int - if err := tx.ForEach(func(name []byte, b *bolt.Bucket) error { - if bytes.HasPrefix(name, []byte(prefix)) { - s.Add(b.Stats()) - count += 1 - } - return nil - }); err != nil { - return err - } - - fmt.Fprintf(cmd.Stdout, "Aggregate statistics for %d buckets\n\n", count) - - fmt.Fprintln(cmd.Stdout, "Page count statistics") - fmt.Fprintf(cmd.Stdout, "\tNumber of logical branch pages: %d\n", s.BranchPageN) - fmt.Fprintf(cmd.Stdout, "\tNumber of physical branch overflow pages: %d\n", s.BranchOverflowN) - fmt.Fprintf(cmd.Stdout, "\tNumber of logical leaf pages: %d\n", s.LeafPageN) - fmt.Fprintf(cmd.Stdout, "\tNumber of physical leaf overflow pages: %d\n", s.LeafOverflowN) - - fmt.Fprintln(cmd.Stdout, "Tree statistics") - fmt.Fprintf(cmd.Stdout, "\tNumber of keys/value pairs: %d\n", s.KeyN) - fmt.Fprintf(cmd.Stdout, "\tNumber of levels in B+tree: %d\n", s.Depth) - - fmt.Fprintln(cmd.Stdout, "Page size utilization") - fmt.Fprintf(cmd.Stdout, "\tBytes allocated for physical branch pages: %d\n", s.BranchAlloc) - var percentage int - if s.BranchAlloc != 0 { - percentage = int(float32(s.BranchInuse) * 100.0 / float32(s.BranchAlloc)) - } - fmt.Fprintf(cmd.Stdout, "\tBytes actually used for branch data: %d (%d%%)\n", s.BranchInuse, percentage) - fmt.Fprintf(cmd.Stdout, "\tBytes allocated for physical leaf pages: %d\n", s.LeafAlloc) - percentage = 0 - if s.LeafAlloc != 0 { - percentage = int(float32(s.LeafInuse) * 100.0 / float32(s.LeafAlloc)) - } - fmt.Fprintf(cmd.Stdout, "\tBytes actually used for leaf data: %d (%d%%)\n", s.LeafInuse, percentage) - - fmt.Fprintln(cmd.Stdout, "Bucket statistics") - fmt.Fprintf(cmd.Stdout, "\tTotal number of buckets: %d\n", s.BucketN) - percentage = 0 - if s.BucketN != 0 { - percentage = int(float32(s.InlineBucketN) * 100.0 / float32(s.BucketN)) - } - fmt.Fprintf(cmd.Stdout, "\tTotal number on inlined buckets: %d (%d%%)\n", s.InlineBucketN, percentage) - percentage = 0 - if s.LeafInuse != 0 { - percentage = int(float32(s.InlineBucketInuse) * 100.0 / float32(s.LeafInuse)) - } - fmt.Fprintf(cmd.Stdout, "\tBytes used for inlined buckets: %d (%d%%)\n", s.InlineBucketInuse, percentage) - - return nil - }) -} - -// Usage returns the help message. -func (cmd *StatsCommand) Usage() string { - return strings.TrimLeft(` -usage: bolt stats PATH - -Stats performs an extensive search of the database to track every page -reference. It starts at the current meta page and recursively iterates -through every accessible bucket. - -The following errors can be reported: - - already freed - The page is referenced more than once in the freelist. - - unreachable unfreed - The page is not referenced by a bucket or in the freelist. - - reachable freed - The page is referenced by a bucket but is also in the freelist. - - out of bounds - A page is referenced that is above the high water mark. - - multiple references - A page is referenced by more than one other page. - - invalid type - The page type is not "meta", "leaf", "branch", or "freelist". - -No errors should occur in your database. However, if for some reason you -experience corruption, please submit a ticket to the Bolt project page: - - https://github.com/boltdb/bolt/issues -`, "\n") -} - -var benchBucketName = []byte("bench") - -// BenchCommand represents the "bench" command execution. -type BenchCommand struct { - Stdin io.Reader - Stdout io.Writer - Stderr io.Writer -} - -// NewBenchCommand returns a BenchCommand using the -func newBenchCommand(m *Main) *BenchCommand { - return &BenchCommand{ - Stdin: m.Stdin, - Stdout: m.Stdout, - Stderr: m.Stderr, - } -} - -// Run executes the "bench" command. -func (cmd *BenchCommand) Run(args ...string) error { - // Parse CLI arguments. - options, err := cmd.ParseFlags(args) - if err != nil { - return err - } - - // Remove path if "-work" is not set. Otherwise keep path. - if options.Work { - fmt.Fprintf(cmd.Stdout, "work: %s\n", options.Path) - } else { - defer os.Remove(options.Path) - } - - // Create database. - db, err := bolt.Open(options.Path, 0666, nil) - if err != nil { - return err - } - db.NoSync = options.NoSync - defer db.Close() - - // Write to the database. - var results BenchResults - if err := cmd.runWrites(db, options, &results); err != nil { - return fmt.Errorf("write: %v", err) - } - - // Read from the database. - if err := cmd.runReads(db, options, &results); err != nil { - return fmt.Errorf("bench: read: %s", err) - } - - // Print results. - fmt.Fprintf(os.Stderr, "# Write\t%v\t(%v/op)\t(%v op/sec)\n", results.WriteDuration, results.WriteOpDuration(), results.WriteOpsPerSecond()) - fmt.Fprintf(os.Stderr, "# Read\t%v\t(%v/op)\t(%v op/sec)\n", results.ReadDuration, results.ReadOpDuration(), results.ReadOpsPerSecond()) - fmt.Fprintln(os.Stderr, "") - return nil -} - -// ParseFlags parses the command line flags. -func (cmd *BenchCommand) ParseFlags(args []string) (*BenchOptions, error) { - var options BenchOptions - - // Parse flagset. - fs := flag.NewFlagSet("", flag.ContinueOnError) - fs.StringVar(&options.ProfileMode, "profile-mode", "rw", "") - fs.StringVar(&options.WriteMode, "write-mode", "seq", "") - fs.StringVar(&options.ReadMode, "read-mode", "seq", "") - fs.IntVar(&options.Iterations, "count", 1000, "") - fs.IntVar(&options.BatchSize, "batch-size", 0, "") - fs.IntVar(&options.KeySize, "key-size", 8, "") - fs.IntVar(&options.ValueSize, "value-size", 32, "") - fs.StringVar(&options.CPUProfile, "cpuprofile", "", "") - fs.StringVar(&options.MemProfile, "memprofile", "", "") - fs.StringVar(&options.BlockProfile, "blockprofile", "", "") - fs.Float64Var(&options.FillPercent, "fill-percent", bolt.DefaultFillPercent, "") - fs.BoolVar(&options.NoSync, "no-sync", false, "") - fs.BoolVar(&options.Work, "work", false, "") - fs.StringVar(&options.Path, "path", "", "") - fs.SetOutput(cmd.Stderr) - if err := fs.Parse(args); err != nil { - return nil, err - } - - // Set batch size to iteration size if not set. - // Require that batch size can be evenly divided by the iteration count. - if options.BatchSize == 0 { - options.BatchSize = options.Iterations - } else if options.Iterations%options.BatchSize != 0 { - return nil, ErrNonDivisibleBatchSize - } - - // Generate temp path if one is not passed in. - if options.Path == "" { - f, err := ioutil.TempFile("", "bolt-bench-") - if err != nil { - return nil, fmt.Errorf("temp file: %s", err) - } - f.Close() - os.Remove(f.Name()) - options.Path = f.Name() - } - - return &options, nil -} - -// Writes to the database. -func (cmd *BenchCommand) runWrites(db *bolt.DB, options *BenchOptions, results *BenchResults) error { - // Start profiling for writes. - if options.ProfileMode == "rw" || options.ProfileMode == "w" { - cmd.startProfiling(options) - } - - t := time.Now() - - var err error - switch options.WriteMode { - case "seq": - err = cmd.runWritesSequential(db, options, results) - case "rnd": - err = cmd.runWritesRandom(db, options, results) - case "seq-nest": - err = cmd.runWritesSequentialNested(db, options, results) - case "rnd-nest": - err = cmd.runWritesRandomNested(db, options, results) - default: - return fmt.Errorf("invalid write mode: %s", options.WriteMode) - } - - // Save time to write. - results.WriteDuration = time.Since(t) - - // Stop profiling for writes only. - if options.ProfileMode == "w" { - cmd.stopProfiling() - } - - return err -} - -func (cmd *BenchCommand) runWritesSequential(db *bolt.DB, options *BenchOptions, results *BenchResults) error { - var i = uint32(0) - return cmd.runWritesWithSource(db, options, results, func() uint32 { i++; return i }) -} - -func (cmd *BenchCommand) runWritesRandom(db *bolt.DB, options *BenchOptions, results *BenchResults) error { - r := rand.New(rand.NewSource(time.Now().UnixNano())) - return cmd.runWritesWithSource(db, options, results, func() uint32 { return r.Uint32() }) -} - -func (cmd *BenchCommand) runWritesSequentialNested(db *bolt.DB, options *BenchOptions, results *BenchResults) error { - var i = uint32(0) - return cmd.runWritesWithSource(db, options, results, func() uint32 { i++; return i }) -} - -func (cmd *BenchCommand) runWritesRandomNested(db *bolt.DB, options *BenchOptions, results *BenchResults) error { - r := rand.New(rand.NewSource(time.Now().UnixNano())) - return cmd.runWritesWithSource(db, options, results, func() uint32 { return r.Uint32() }) -} - -func (cmd *BenchCommand) runWritesWithSource(db *bolt.DB, options *BenchOptions, results *BenchResults, keySource func() uint32) error { - results.WriteOps = options.Iterations - - for i := 0; i < options.Iterations; i += options.BatchSize { - if err := db.Update(func(tx *bolt.Tx) error { - b, _ := tx.CreateBucketIfNotExists(benchBucketName) - b.FillPercent = options.FillPercent - - for j := 0; j < options.BatchSize; j++ { - key := make([]byte, options.KeySize) - value := make([]byte, options.ValueSize) - - // Write key as uint32. - binary.BigEndian.PutUint32(key, keySource()) - - // Insert key/value. - if err := b.Put(key, value); err != nil { - return err - } - } - - return nil - }); err != nil { - return err - } - } - return nil -} - -func (cmd *BenchCommand) runWritesNestedWithSource(db *bolt.DB, options *BenchOptions, results *BenchResults, keySource func() uint32) error { - results.WriteOps = options.Iterations - - for i := 0; i < options.Iterations; i += options.BatchSize { - if err := db.Update(func(tx *bolt.Tx) error { - top, err := tx.CreateBucketIfNotExists(benchBucketName) - if err != nil { - return err - } - top.FillPercent = options.FillPercent - - // Create bucket key. - name := make([]byte, options.KeySize) - binary.BigEndian.PutUint32(name, keySource()) - - // Create bucket. - b, err := top.CreateBucketIfNotExists(name) - if err != nil { - return err - } - b.FillPercent = options.FillPercent - - for j := 0; j < options.BatchSize; j++ { - var key = make([]byte, options.KeySize) - var value = make([]byte, options.ValueSize) - - // Generate key as uint32. - binary.BigEndian.PutUint32(key, keySource()) - - // Insert value into subbucket. - if err := b.Put(key, value); err != nil { - return err - } - } - - return nil - }); err != nil { - return err - } - } - return nil -} - -// Reads from the database. -func (cmd *BenchCommand) runReads(db *bolt.DB, options *BenchOptions, results *BenchResults) error { - // Start profiling for reads. - if options.ProfileMode == "r" { - cmd.startProfiling(options) - } - - t := time.Now() - - var err error - switch options.ReadMode { - case "seq": - switch options.WriteMode { - case "seq-nest", "rnd-nest": - err = cmd.runReadsSequentialNested(db, options, results) - default: - err = cmd.runReadsSequential(db, options, results) - } - default: - return fmt.Errorf("invalid read mode: %s", options.ReadMode) - } - - // Save read time. - results.ReadDuration = time.Since(t) - - // Stop profiling for reads. - if options.ProfileMode == "rw" || options.ProfileMode == "r" { - cmd.stopProfiling() - } - - return err -} - -func (cmd *BenchCommand) runReadsSequential(db *bolt.DB, options *BenchOptions, results *BenchResults) error { - return db.View(func(tx *bolt.Tx) error { - t := time.Now() - - for { - var count int - - c := tx.Bucket(benchBucketName).Cursor() - for k, v := c.First(); k != nil; k, v = c.Next() { - if v == nil { - return errors.New("invalid value") - } - count++ - } - - if options.WriteMode == "seq" && count != options.Iterations { - return fmt.Errorf("read seq: iter mismatch: expected %d, got %d", options.Iterations, count) - } - - results.ReadOps += count - - // Make sure we do this for at least a second. - if time.Since(t) >= time.Second { - break - } - } - - return nil - }) -} - -func (cmd *BenchCommand) runReadsSequentialNested(db *bolt.DB, options *BenchOptions, results *BenchResults) error { - return db.View(func(tx *bolt.Tx) error { - t := time.Now() - - for { - var count int - var top = tx.Bucket(benchBucketName) - if err := top.ForEach(func(name, _ []byte) error { - c := top.Bucket(name).Cursor() - for k, v := c.First(); k != nil; k, v = c.Next() { - if v == nil { - return ErrInvalidValue - } - count++ - } - return nil - }); err != nil { - return err - } - - if options.WriteMode == "seq-nest" && count != options.Iterations { - return fmt.Errorf("read seq-nest: iter mismatch: expected %d, got %d", options.Iterations, count) - } - - results.ReadOps += count - - // Make sure we do this for at least a second. - if time.Since(t) >= time.Second { - break - } - } - - return nil - }) -} - -// File handlers for the various profiles. -var cpuprofile, memprofile, blockprofile *os.File - -// Starts all profiles set on the options. -func (cmd *BenchCommand) startProfiling(options *BenchOptions) { - var err error - - // Start CPU profiling. - if options.CPUProfile != "" { - cpuprofile, err = os.Create(options.CPUProfile) - if err != nil { - fmt.Fprintf(cmd.Stderr, "bench: could not create cpu profile %q: %v\n", options.CPUProfile, err) - os.Exit(1) - } - pprof.StartCPUProfile(cpuprofile) - } - - // Start memory profiling. - if options.MemProfile != "" { - memprofile, err = os.Create(options.MemProfile) - if err != nil { - fmt.Fprintf(cmd.Stderr, "bench: could not create memory profile %q: %v\n", options.MemProfile, err) - os.Exit(1) - } - runtime.MemProfileRate = 4096 - } - - // Start fatal profiling. - if options.BlockProfile != "" { - blockprofile, err = os.Create(options.BlockProfile) - if err != nil { - fmt.Fprintf(cmd.Stderr, "bench: could not create block profile %q: %v\n", options.BlockProfile, err) - os.Exit(1) - } - runtime.SetBlockProfileRate(1) - } -} - -// Stops all profiles. -func (cmd *BenchCommand) stopProfiling() { - if cpuprofile != nil { - pprof.StopCPUProfile() - cpuprofile.Close() - cpuprofile = nil - } - - if memprofile != nil { - pprof.Lookup("heap").WriteTo(memprofile, 0) - memprofile.Close() - memprofile = nil - } - - if blockprofile != nil { - pprof.Lookup("block").WriteTo(blockprofile, 0) - blockprofile.Close() - blockprofile = nil - runtime.SetBlockProfileRate(0) - } -} - -// BenchOptions represents the set of options that can be passed to "bolt bench". -type BenchOptions struct { - ProfileMode string - WriteMode string - ReadMode string - Iterations int - BatchSize int - KeySize int - ValueSize int - CPUProfile string - MemProfile string - BlockProfile string - StatsInterval time.Duration - FillPercent float64 - NoSync bool - Work bool - Path string -} - -// BenchResults represents the performance results of the benchmark. -type BenchResults struct { - WriteOps int - WriteDuration time.Duration - ReadOps int - ReadDuration time.Duration -} - -// Returns the duration for a single write operation. -func (r *BenchResults) WriteOpDuration() time.Duration { - if r.WriteOps == 0 { - return 0 - } - return r.WriteDuration / time.Duration(r.WriteOps) -} - -// Returns average number of write operations that can be performed per second. -func (r *BenchResults) WriteOpsPerSecond() int { - var op = r.WriteOpDuration() - if op == 0 { - return 0 - } - return int(time.Second) / int(op) -} - -// Returns the duration for a single read operation. -func (r *BenchResults) ReadOpDuration() time.Duration { - if r.ReadOps == 0 { - return 0 - } - return r.ReadDuration / time.Duration(r.ReadOps) -} - -// Returns average number of read operations that can be performed per second. -func (r *BenchResults) ReadOpsPerSecond() int { - var op = r.ReadOpDuration() - if op == 0 { - return 0 - } - return int(time.Second) / int(op) -} - -type PageError struct { - ID int - Err error -} - -func (e *PageError) Error() string { - return fmt.Sprintf("page error: id=%d, err=%s", e.ID, e.Err) -} - -// isPrintable returns true if the string is valid unicode and contains only printable runes. -func isPrintable(s string) bool { - if !utf8.ValidString(s) { - return false - } - for _, ch := range s { - if !unicode.IsPrint(ch) { - return false - } - } - return true -} - -// ReadPage reads page info & full page data from a path. -// This is not transactionally safe. -func ReadPage(path string, pageID int) (*page, []byte, error) { - // Find page size. - pageSize, err := ReadPageSize(path) - if err != nil { - return nil, nil, fmt.Errorf("read page size: %s", err) - } - - // Open database file. - f, err := os.Open(path) - if err != nil { - return nil, nil, err - } - defer f.Close() - - // Read one block into buffer. - buf := make([]byte, pageSize) - if n, err := f.ReadAt(buf, int64(pageID*pageSize)); err != nil { - return nil, nil, err - } else if n != len(buf) { - return nil, nil, io.ErrUnexpectedEOF - } - - // Determine total number of blocks. - p := (*page)(unsafe.Pointer(&buf[0])) - overflowN := p.overflow - - // Re-read entire page (with overflow) into buffer. - buf = make([]byte, (int(overflowN)+1)*pageSize) - if n, err := f.ReadAt(buf, int64(pageID*pageSize)); err != nil { - return nil, nil, err - } else if n != len(buf) { - return nil, nil, io.ErrUnexpectedEOF - } - p = (*page)(unsafe.Pointer(&buf[0])) - - return p, buf, nil -} - -// ReadPageSize reads page size a path. -// This is not transactionally safe. -func ReadPageSize(path string) (int, error) { - // Open database file. - f, err := os.Open(path) - if err != nil { - return 0, err - } - defer f.Close() - - // Read 4KB chunk. - buf := make([]byte, 4096) - if _, err := io.ReadFull(f, buf); err != nil { - return 0, err - } - - // Read page size from metadata. - m := (*meta)(unsafe.Pointer(&buf[PageHeaderSize])) - return int(m.pageSize), nil -} - -// atois parses a slice of strings into integers. -func atois(strs []string) ([]int, error) { - var a []int - for _, str := range strs { - i, err := strconv.Atoi(str) - if err != nil { - return nil, err - } - a = append(a, i) - } - return a, nil -} - -// DO NOT EDIT. Copied from the "bolt" package. -const maxAllocSize = 0xFFFFFFF - -// DO NOT EDIT. Copied from the "bolt" package. -const ( - branchPageFlag = 0x01 - leafPageFlag = 0x02 - metaPageFlag = 0x04 - freelistPageFlag = 0x10 -) - -// DO NOT EDIT. Copied from the "bolt" package. -const bucketLeafFlag = 0x01 - -// DO NOT EDIT. Copied from the "bolt" package. -type pgid uint64 - -// DO NOT EDIT. Copied from the "bolt" package. -type txid uint64 - -// DO NOT EDIT. Copied from the "bolt" package. -type meta struct { - magic uint32 - version uint32 - pageSize uint32 - flags uint32 - root bucket - freelist pgid - pgid pgid - txid txid - checksum uint64 -} - -// DO NOT EDIT. Copied from the "bolt" package. -type bucket struct { - root pgid - sequence uint64 -} - -// DO NOT EDIT. Copied from the "bolt" package. -type page struct { - id pgid - flags uint16 - count uint16 - overflow uint32 - ptr uintptr -} - -// DO NOT EDIT. Copied from the "bolt" package. -func (p *page) Type() string { - if (p.flags & branchPageFlag) != 0 { - return "branch" - } else if (p.flags & leafPageFlag) != 0 { - return "leaf" - } else if (p.flags & metaPageFlag) != 0 { - return "meta" - } else if (p.flags & freelistPageFlag) != 0 { - return "freelist" - } - return fmt.Sprintf("unknown<%02x>", p.flags) -} - -// DO NOT EDIT. Copied from the "bolt" package. -func (p *page) leafPageElement(index uint16) *leafPageElement { - n := &((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[index] - return n -} - -// DO NOT EDIT. Copied from the "bolt" package. -func (p *page) branchPageElement(index uint16) *branchPageElement { - return &((*[0x7FFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[index] -} - -// DO NOT EDIT. Copied from the "bolt" package. -type branchPageElement struct { - pos uint32 - ksize uint32 - pgid pgid -} - -// DO NOT EDIT. Copied from the "bolt" package. -func (n *branchPageElement) key() []byte { - buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) - return buf[n.pos : n.pos+n.ksize] -} - -// DO NOT EDIT. Copied from the "bolt" package. -type leafPageElement struct { - flags uint32 - pos uint32 - ksize uint32 - vsize uint32 -} - -// DO NOT EDIT. Copied from the "bolt" package. -func (n *leafPageElement) key() []byte { - buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) - return buf[n.pos : n.pos+n.ksize] -} - -// DO NOT EDIT. Copied from the "bolt" package. -func (n *leafPageElement) value() []byte { - buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) - return buf[n.pos+n.ksize : n.pos+n.ksize+n.vsize] -} diff --git a/vendor/github.com/codegangsta/negroni/translations/README_pt_br.md b/vendor/github.com/codegangsta/negroni/translations/README_pt_br.md deleted file mode 100644 index 0ecaafc712b..00000000000 --- a/vendor/github.com/codegangsta/negroni/translations/README_pt_br.md +++ /dev/null @@ -1,165 +0,0 @@ -# Negroni [![GoDoc](https://godoc.org/github.com/codegangsta/negroni?status.svg)](http://godoc.org/github.com/codegangsta/negroni) [![wercker status](https://app.wercker.com/status/13688a4a94b82d84a0b8d038c4965b61/s "wercker status")](https://app.wercker.com/project/bykey/13688a4a94b82d84a0b8d038c4965b61) - -Negroni é uma abordagem idiomática para middleware web em Go. É pequeno, não intrusivo, e incentiva uso da biblioteca `net/http`. - -Se gosta da idéia do [Martini](http://github.com/go-martini/martini), mas acha que contém muita mágica, então Negroni é ideal. - -## Começando - -Depois de instalar Go e definir seu [GOPATH](http://golang.org/doc/code.html#GOPATH), criar seu primeirto arquivo `.go`. Iremos chamá-lo `server.go`. - -~~~ go -package main - -import ( - "github.com/codegangsta/negroni" - "net/http" - "fmt" -) - -func main() { - mux := http.NewServeMux() - mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { - fmt.Fprintf(w, "Welcome to the home page!") - }) - - n := negroni.Classic() - n.UseHandler(mux) - n.Run(":3000") -} -~~~ - -Depois instale o pacote Negroni (**go 1.1** ou superior) -~~~ -go get github.com/codegangsta/negroni -~~~ - -Depois execute seu servidor: -~~~ -go run server.go -~~~ - -Agora terá um servidor web Go net/http rodando em `localhost:3000`. - -## Precisa de Ajuda? -Se você tem uma pergunta ou pedido de recurso,[go ask the mailing list](https://groups.google.com/forum/#!forum/negroni-users). O Github issuses para o Negroni será usado exclusivamente para Reportar bugs e pull requests. - -## Negroni é um Framework? -Negroni **não** é a framework. É uma biblioteca que é desenhada para trabalhar diretamente com net/http. - -## Roteamento? -Negroni é TSPR(Traga seu próprio Roteamento). A comunidade Go já tem um grande número de roteadores http disponíveis, Negroni tenta rodar bem com todos eles pelo suporte total `net/http`/ Por exemplo, a integração com [Gorilla Mux](http://github.com/gorilla/mux) se parece com isso: - -~~~ go -router := mux.NewRouter() -router.HandleFunc("/", HomeHandler) - -n := negroni.New(Middleware1, Middleware2) -// Or use a middleware with the Use() function -n.Use(Middleware3) -// router goes last -n.UseHandler(router) - -n.Run(":3000") -~~~ - -## `negroni.Classic()` -`negroni.Classic()` fornece alguns middlewares padrão que são útil para maioria das aplicações: - -* `negroni.Recovery` - Panic Recovery Middleware. -* `negroni.Logging` - Request/Response Logging Middleware. -* `negroni.Static` - Static File serving under the "public" directory. - -Isso torna muito fácil começar com alguns recursos úteis do Negroni. - -## Handlers -Negroni fornece um middleware de fluxo bidirecional. Isso é feito através da interface `negroni.Handler`: - -~~~ go -type Handler interface { - ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) -} -~~~ - -Se um middleware não tenha escrito o ResponseWriter, ele deve chamar a próxima `http.HandlerFunc` na cadeia para produzir o próximo handler middleware. Isso pode ser usado muito bem: - -~~~ go -func MyMiddleware(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) { - // do some stuff before - next(rw, r) - // do some stuff after -} -~~~ - -E pode mapear isso para a cadeia de handler com a função `Use`: - -~~~ go -n := negroni.New() -n.Use(negroni.HandlerFunc(MyMiddleware)) -~~~ - -Você também pode mapear `http.Handler` antigos: - -~~~ go -n := negroni.New() - -mux := http.NewServeMux() -// map your routes - -n.UseHandler(mux) - -n.Run(":3000") -~~~ - -## `Run()` -Negroni tem uma função de conveniência chamada `Run`. `Run` pega um endereço de string idêntico para [http.ListenAndServe](http://golang.org/pkg/net/http#ListenAndServe). - -~~~ go -n := negroni.Classic() -// ... -log.Fatal(http.ListenAndServe(":8080", n)) -~~~ - -## Middleware para Rotas Específicas -Se você tem um grupo de rota com rotas que precisam ser executadas por um middleware específico, pode simplesmente criar uma nova instância de Negroni e usar no seu Manipular de rota. - -~~~ go -router := mux.NewRouter() -adminRoutes := mux.NewRouter() -// add admin routes here - -// Criar um middleware negroni para admin -router.Handle("/admin", negroni.New( - Middleware1, - Middleware2, - negroni.Wrap(adminRoutes), -)) -~~~ - -## Middleware de Terceiros - -Aqui está uma lista atual de Middleware Compatíveis com Negroni. Sinta se livre para mandar um PR vinculando seu middleware if construiu um: - - -| Middleware | Autor | Descrição | -| -----------|--------|-------------| -| [Graceful](https://github.com/stretchr/graceful) | [Tyler Bunnell](https://github.com/tylerb) | Graceful HTTP Shutdown | -| [secure](https://github.com/unrolled/secure) | [Cory Jacobsen](https://github.com/unrolled) | Implementa rapidamente itens de segurança.| -| [binding](https://github.com/mholt/binding) | [Matt Holt](https://github.com/mholt) | Handler para mapeamento/validação de um request a estrutura. | -| [logrus](https://github.com/meatballhat/negroni-logrus) | [Dan Buch](https://github.com/meatballhat) | Logrus-based logger | -| [render](https://github.com/unrolled/render) | [Cory Jacobsen](https://github.com/unrolled) | Pacote para renderizar JSON, XML, e templates HTML. | -| [gorelic](https://github.com/jingweno/negroni-gorelic) | [Jingwen Owen Ou](https://github.com/jingweno) | New Relic agent for Go runtime | -| [gzip](https://github.com/phyber/negroni-gzip) | [phyber](https://github.com/phyber) | Handler para adicionar compreção gzip para as requisições | -| [oauth2](https://github.com/goincremental/negroni-oauth2) | [David Bochenski](https://github.com/bochenski) | Handler que prove sistema de login OAuth 2.0 para aplicações Martini. Google Sign-in, Facebook Connect e Github login são suportados. | -| [sessions](https://github.com/goincremental/negroni-sessions) | [David Bochenski](https://github.com/bochenski) | Handler que provê o serviço de sessão. | -| [permissions](https://github.com/xyproto/permissions) | [Alexander Rødseth](https://github.com/xyproto) | Cookies, usuários e permissões. | -| [onthefly](https://github.com/xyproto/onthefly) | [Alexander Rødseth](https://github.com/xyproto) | Pacote para gerar TinySVG, HTML e CSS em tempo real. | - -## Exemplos -[Alexander Rødseth](https://github.com/xyproto) criou [mooseware](https://github.com/xyproto/mooseware), uma estrutura para escrever um handler middleware Negroni. - -## Servidor com autoreload? -[gin](https://github.com/codegangsta/gin) e [fresh](https://github.com/pilu/fresh) são aplicativos para autoreload do Negroni. - -## Sobre -Negroni é obsessivamente desenhado por ninguém menos que [Code Gangsta](http://codegangsta.io/) diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/doc.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/doc.go deleted file mode 100644 index ad4b653ad71..00000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 CoreOS, Inc. -// -// 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 concurrency implements concurrency operations on top of -// etcd such as distributed locks, barriers, and elections. -package concurrency diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/election.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/election.go deleted file mode 100644 index 991bd2628c1..00000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/election.go +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright 2016 CoreOS, Inc. -// -// 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 concurrency - -import ( - "errors" - - v3 "github.com/coreos/etcd/clientv3" - "github.com/coreos/etcd/storage/storagepb" - "golang.org/x/net/context" -) - -var ( - ErrElectionNotLeader = errors.New("election: not leader") - ErrElectionNoLeader = errors.New("election: no leader") -) - -type Election struct { - client *v3.Client - - keyPrefix string - - leaderKey string - leaderRev int64 - leaderSession *Session -} - -// NewElection returns a new election on a given key prefix. -func NewElection(client *v3.Client, pfx string) *Election { - return &Election{client: client, keyPrefix: pfx} -} - -// Campaign puts a value as eligible for the election. It blocks until -// it is elected, an error occurs, or the context is cancelled. -func (e *Election) Campaign(ctx context.Context, val string) error { - s, serr := NewSession(e.client) - if serr != nil { - return serr - } - - k, rev, err := NewUniqueKV(ctx, e.client, e.keyPrefix, val, v3.WithLease(s.Lease())) - if err == nil { - err = waitDeletes(ctx, e.client, e.keyPrefix, v3.WithPrefix(), v3.WithRev(rev-1)) - } - - if err != nil { - // clean up in case of context cancel - select { - case <-ctx.Done(): - e.client.Delete(e.client.Ctx(), k) - default: - } - return err - } - - e.leaderKey, e.leaderRev, e.leaderSession = k, rev, s - return nil -} - -// Proclaim lets the leader announce a new value without another election. -func (e *Election) Proclaim(ctx context.Context, val string) error { - if e.leaderSession == nil { - return ErrElectionNotLeader - } - cmp := v3.Compare(v3.CreateRevision(e.leaderKey), "=", e.leaderRev) - txn := e.client.Txn(ctx).If(cmp) - txn = txn.Then(v3.OpPut(e.leaderKey, val, v3.WithLease(e.leaderSession.Lease()))) - tresp, terr := txn.Commit() - if terr != nil { - return terr - } - if !tresp.Succeeded { - e.leaderKey = "" - return ErrElectionNotLeader - } - return nil -} - -// Resign lets a leader start a new election. -func (e *Election) Resign() (err error) { - if e.leaderSession == nil { - return nil - } - _, err = e.client.Delete(e.client.Ctx(), e.leaderKey) - e.leaderKey = "" - e.leaderSession = nil - return err -} - -// Leader returns the leader value for the current election. -func (e *Election) Leader() (string, error) { - resp, err := e.client.Get(e.client.Ctx(), e.keyPrefix, v3.WithFirstCreate()...) - if err != nil { - return "", err - } else if len(resp.Kvs) == 0 { - // no leader currently elected - return "", ErrElectionNoLeader - } - return string(resp.Kvs[0].Value), nil -} - -// Observe returns a channel that observes all leader proposal values as -// GetResponse values on the current leader key. The channel closes when -// the context is cancelled or the underlying watcher is otherwise disrupted. -func (e *Election) Observe(ctx context.Context) <-chan v3.GetResponse { - retc := make(chan v3.GetResponse) - go e.observe(ctx, retc) - return retc -} - -func (e *Election) observe(ctx context.Context, ch chan<- v3.GetResponse) { - defer close(ch) - for { - resp, err := e.client.Get(ctx, e.keyPrefix, v3.WithFirstCreate()...) - if err != nil { - return - } - - var kv *storagepb.KeyValue - - cctx, cancel := context.WithCancel(ctx) - if len(resp.Kvs) == 0 { - // wait for first key put on prefix - opts := []v3.OpOption{v3.WithRev(resp.Header.Revision), v3.WithPrefix()} - wch := e.client.Watch(cctx, e.keyPrefix, opts...) - - for kv == nil { - wr, ok := <-wch - if !ok || wr.Err() != nil { - cancel() - return - } - // only accept PUTs; a DELETE will make observe() spin - for _, ev := range wr.Events { - if ev.Type == storagepb.PUT { - kv = ev.Kv - break - } - } - } - } else { - kv = resp.Kvs[0] - } - - wch := e.client.Watch(cctx, string(kv.Key), v3.WithRev(kv.ModRevision)) - keyDeleted := false - for !keyDeleted { - wr, ok := <-wch - if !ok { - return - } - for _, ev := range wr.Events { - if ev.Type == storagepb.DELETE { - keyDeleted = true - break - } - resp.Header = &wr.Header - resp.Kvs = []*storagepb.KeyValue{ev.Kv} - select { - case ch <- *resp: - case <-cctx.Done(): - return - } - } - } - cancel() - } -} - -// Key returns the leader key if elected, empty string otherwise. -func (e *Election) Key() string { return e.leaderKey } diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/key.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/key.go deleted file mode 100644 index f2c6a3329f1..00000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/key.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2016 CoreOS, Inc. -// -// 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 concurrency - -import ( - "fmt" - "math" - "time" - - v3 "github.com/coreos/etcd/clientv3" - "github.com/coreos/etcd/storage/storagepb" - "golang.org/x/net/context" -) - -// NewUniqueKey creates a new key from a given prefix. -func NewUniqueKey(ctx context.Context, kv v3.KV, pfx string, opts ...v3.OpOption) (string, int64, error) { - return NewUniqueKV(ctx, kv, pfx, "", opts...) -} - -func NewUniqueKV(ctx context.Context, kv v3.KV, pfx, val string, opts ...v3.OpOption) (string, int64, error) { - for { - newKey := fmt.Sprintf("%s/%v", pfx, time.Now().UnixNano()) - put := v3.OpPut(newKey, val, opts...) - cmp := v3.Compare(v3.ModRevision(newKey), "=", 0) - resp, err := kv.Txn(ctx).If(cmp).Then(put).Commit() - if err != nil { - return "", 0, err - } - if !resp.Succeeded { - continue - } - return newKey, resp.Header.Revision, nil - } -} - -func waitUpdate(ctx context.Context, client *v3.Client, key string, opts ...v3.OpOption) error { - cctx, cancel := context.WithCancel(ctx) - defer cancel() - wresp, ok := <-client.Watch(cctx, key, opts...) - if !ok { - return ctx.Err() - } - return wresp.Err() -} - -func waitDelete(ctx context.Context, client *v3.Client, key string, rev int64) error { - cctx, cancel := context.WithCancel(ctx) - defer cancel() - wch := client.Watch(cctx, key, v3.WithRev(rev)) - for wr := range wch { - for _, ev := range wr.Events { - if ev.Type == storagepb.DELETE { - return nil - } - } - } - if err := ctx.Err(); err != nil { - return err - } - return fmt.Errorf("lost watcher waiting for delete") -} - -// waitDeletes efficiently waits until all keys matched by Get(key, opts...) are deleted -func waitDeletes(ctx context.Context, client *v3.Client, key string, opts ...v3.OpOption) error { - getOpts := []v3.OpOption{v3.WithSort(v3.SortByCreateRevision, v3.SortAscend)} - getOpts = append(getOpts, opts...) - resp, err := client.Get(ctx, key, getOpts...) - maxRev := int64(math.MaxInt64) - getOpts = append(getOpts, v3.WithRev(0)) - for err == nil { - for len(resp.Kvs) > 0 { - i := len(resp.Kvs) - 1 - if resp.Kvs[i].CreateRevision <= maxRev { - break - } - resp.Kvs = resp.Kvs[:i] - } - if len(resp.Kvs) == 0 { - break - } - lastKV := resp.Kvs[len(resp.Kvs)-1] - maxRev = lastKV.CreateRevision - err = waitDelete(ctx, client, string(lastKV.Key), maxRev) - if err != nil || len(resp.Kvs) == 1 { - break - } - getOpts = append(getOpts, v3.WithLimit(int64(len(resp.Kvs)-1))) - resp, err = client.Get(ctx, key, getOpts...) - } - return err -} diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/mutex.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/mutex.go deleted file mode 100644 index 8ea8acd52d8..00000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/mutex.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2016 CoreOS, Inc. -// -// 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 concurrency - -import ( - "sync" - - v3 "github.com/coreos/etcd/clientv3" - "golang.org/x/net/context" -) - -// Mutex implements the sync Locker interface with etcd -type Mutex struct { - client *v3.Client - - pfx string - myKey string - myRev int64 -} - -func NewMutex(client *v3.Client, pfx string) *Mutex { - return &Mutex{client, pfx, "", -1} -} - -// Lock locks the mutex with a cancellable context. If the context is cancelled -// while trying to acquire the lock, the mutex tries to clean its stale lock entry. -func (m *Mutex) Lock(ctx context.Context) error { - s, err := NewSession(m.client) - if err != nil { - return err - } - // put self in lock waiters via myKey; oldest waiter holds lock - m.myKey, m.myRev, err = NewUniqueKey(ctx, m.client, m.pfx, v3.WithLease(s.Lease())) - // wait for deletion revisions prior to myKey - err = waitDeletes(ctx, m.client, m.pfx, v3.WithPrefix(), v3.WithRev(m.myRev-1)) - // release lock key if cancelled - select { - case <-ctx.Done(): - m.Unlock() - default: - } - return err -} - -func (m *Mutex) Unlock() error { - if _, err := m.client.Delete(m.client.Ctx(), m.myKey); err != nil { - return err - } - m.myKey = "\x00" - m.myRev = -1 - return nil -} - -func (m *Mutex) IsOwner() v3.Cmp { - return v3.Compare(v3.CreateRevision(m.myKey), "=", m.myRev) -} - -func (m *Mutex) Key() string { return m.myKey } - -type lockerMutex struct{ *Mutex } - -func (lm *lockerMutex) Lock() { - if err := lm.Mutex.Lock(lm.client.Ctx()); err != nil { - panic(err) - } -} -func (lm *lockerMutex) Unlock() { - if err := lm.Mutex.Unlock(); err != nil { - panic(err) - } -} - -// NewLocker creates a sync.Locker backed by an etcd mutex. -func NewLocker(client *v3.Client, pfx string) sync.Locker { - return &lockerMutex{NewMutex(client, pfx)} -} diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/session.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/session.go deleted file mode 100644 index b348a4b3cc7..00000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/session.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2016 CoreOS, Inc. -// -// 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 concurrency - -import ( - "sync" - - v3 "github.com/coreos/etcd/clientv3" - "golang.org/x/net/context" -) - -// only keep one ephemeral lease per client -var clientSessions clientSessionMgr = clientSessionMgr{sessions: make(map[*v3.Client]*Session)} - -const sessionTTL = 60 - -type clientSessionMgr struct { - sessions map[*v3.Client]*Session - mu sync.Mutex -} - -// Session represents a lease kept alive for the lifetime of a client. -// Fault-tolerant applications may use sessions to reason about liveness. -type Session struct { - client *v3.Client - id v3.LeaseID - - cancel context.CancelFunc - donec <-chan struct{} -} - -// NewSession gets the leased session for a client. -func NewSession(client *v3.Client) (*Session, error) { - clientSessions.mu.Lock() - defer clientSessions.mu.Unlock() - if s, ok := clientSessions.sessions[client]; ok { - return s, nil - } - - resp, err := client.Grant(client.Ctx(), sessionTTL) - if err != nil { - return nil, err - } - id := v3.LeaseID(resp.ID) - - ctx, cancel := context.WithCancel(client.Ctx()) - keepAlive, err := client.KeepAlive(ctx, id) - if err != nil || keepAlive == nil { - return nil, err - } - - donec := make(chan struct{}) - s := &Session{client: client, id: id, cancel: cancel, donec: donec} - clientSessions.sessions[client] = s - - // keep the lease alive until client error or cancelled context - go func() { - defer func() { - clientSessions.mu.Lock() - delete(clientSessions.sessions, client) - clientSessions.mu.Unlock() - close(donec) - }() - for range keepAlive { - // eat messages until keep alive channel closes - } - }() - - return s, nil -} - -// Lease is the lease ID for keys bound to the session. -func (s *Session) Lease() v3.LeaseID { return s.id } - -// Done returns a channel that closes when the lease is orphaned, expires, or -// is otherwise no longer being refreshed. -func (s *Session) Done() <-chan struct{} { return s.donec } - -// Orphan ends the refresh for the session lease. This is useful -// in case the state of the client connection is indeterminate (revoke -// would fail) or when transferring lease ownership. -func (s *Session) Orphan() { - s.cancel() - <-s.donec -} - -// Close orphans the session and revokes the session lease. -func (s *Session) Close() error { - s.Orphan() - _, err := s.client.Revoke(s.client.Ctx(), s.id) - return err -} diff --git a/vendor/github.com/coreos/etcd/clientv3/concurrency/stm.go b/vendor/github.com/coreos/etcd/clientv3/concurrency/stm.go deleted file mode 100644 index 7f3f9bcc782..00000000000 --- a/vendor/github.com/coreos/etcd/clientv3/concurrency/stm.go +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright 2016 CoreOS, Inc. -// -// 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 concurrency - -import ( - v3 "github.com/coreos/etcd/clientv3" - "golang.org/x/net/context" -) - -// STM is an interface for software transactional memory. -type STM interface { - // Get returns the value for a key and inserts the key in the txn's read set. - // If Get fails, it aborts the transaction with an error, never returning. - Get(key string) string - // Put adds a value for a key to the write set. - Put(key, val string, opts ...v3.OpOption) - // Rev returns the revision of a key in the read set. - Rev(key string) int64 - // Del deletes a key. - Del(key string) - - // commit attempts to apply the txn's changes to the server. - commit() *v3.TxnResponse - reset() -} - -// stmError safely passes STM errors through panic to the STM error channel. -type stmError struct{ err error } - -// NewSTMRepeatable initiates new repeatable read transaction; reads within -// the same transaction attempt always return the same data. -func NewSTMRepeatable(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) { - s := &stm{client: c, ctx: ctx, getOpts: []v3.OpOption{v3.WithSerializable()}} - return runSTM(s, apply) -} - -// NewSTMSerializable initiates a new serialized transaction; reads within the -// same transactiona attempt return data from the revision of the first read. -func NewSTMSerializable(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) { - s := &stmSerializable{ - stm: stm{client: c, ctx: ctx}, - prefetch: make(map[string]*v3.GetResponse), - } - return runSTM(s, apply) -} - -type stmResponse struct { - resp *v3.TxnResponse - err error -} - -func runSTM(s STM, apply func(STM) error) (*v3.TxnResponse, error) { - outc := make(chan stmResponse, 1) - go func() { - defer func() { - if r := recover(); r != nil { - e, ok := r.(stmError) - if !ok { - // client apply panicked - panic(r) - } - outc <- stmResponse{nil, e.err} - } - }() - var out stmResponse - for { - s.reset() - if out.err = apply(s); out.err != nil { - break - } - if out.resp = s.commit(); out.resp != nil { - break - } - } - outc <- out - }() - r := <-outc - return r.resp, r.err -} - -// stm implements repeatable-read software transactional memory over etcd -type stm struct { - client *v3.Client - ctx context.Context - // rset holds read key values and revisions - rset map[string]*v3.GetResponse - // wset holds overwritten keys and their values - wset map[string]stmPut - // getOpts are the opts used for gets - getOpts []v3.OpOption -} - -type stmPut struct { - val string - op v3.Op -} - -func (s *stm) Get(key string) string { - if wv, ok := s.wset[key]; ok { - return wv.val - } - return respToValue(s.fetch(key)) -} - -func (s *stm) Put(key, val string, opts ...v3.OpOption) { - s.wset[key] = stmPut{val, v3.OpPut(key, val, opts...)} -} - -func (s *stm) Del(key string) { s.wset[key] = stmPut{"", v3.OpDelete(key)} } - -func (s *stm) Rev(key string) int64 { - if resp := s.fetch(key); resp != nil && len(resp.Kvs) != 0 { - return resp.Kvs[0].ModRevision - } - return 0 -} - -func (s *stm) commit() *v3.TxnResponse { - txnresp, err := s.client.Txn(s.ctx).If(s.cmps()...).Then(s.puts()...).Commit() - if err != nil { - panic(stmError{err}) - } - if txnresp.Succeeded { - return txnresp - } - return nil -} - -// cmps guards the txn from updates to read set -func (s *stm) cmps() (cmps []v3.Cmp) { - for k, rk := range s.rset { - cmps = append(cmps, isKeyCurrent(k, rk)) - } - return -} - -func (s *stm) fetch(key string) *v3.GetResponse { - if resp, ok := s.rset[key]; ok { - return resp - } - resp, err := s.client.Get(s.ctx, key, s.getOpts...) - if err != nil { - panic(stmError{err}) - } - s.rset[key] = resp - return resp -} - -// puts is the list of ops for all pending writes -func (s *stm) puts() (puts []v3.Op) { - for _, v := range s.wset { - puts = append(puts, v.op) - } - return -} - -func (s *stm) reset() { - s.rset = make(map[string]*v3.GetResponse) - s.wset = make(map[string]stmPut) -} - -type stmSerializable struct { - stm - prefetch map[string]*v3.GetResponse -} - -func (s *stmSerializable) Get(key string) string { - if wv, ok := s.wset[key]; ok { - return wv.val - } - firstRead := len(s.rset) == 0 - if resp, ok := s.prefetch[key]; ok { - delete(s.prefetch, key) - s.rset[key] = resp - } - resp := s.stm.fetch(key) - if firstRead { - // txn's base revision is defined by the first read - s.getOpts = []v3.OpOption{ - v3.WithRev(resp.Header.Revision), - v3.WithSerializable(), - } - } - return respToValue(resp) -} - -func (s *stmSerializable) Rev(key string) int64 { - s.Get(key) - return s.stm.Rev(key) -} - -func (s *stmSerializable) gets() (keys []string, ops []v3.Op) { - for k := range s.rset { - keys = append(keys, k) - ops = append(ops, v3.OpGet(k)) - } - return -} - -func (s *stmSerializable) commit() *v3.TxnResponse { - keys, getops := s.gets() - txn := s.client.Txn(s.ctx).If(s.cmps()...).Then(s.puts()...) - // use Else to prefetch keys in case of conflict to save a round trip - txnresp, err := txn.Else(getops...).Commit() - if err != nil { - panic(stmError{err}) - } - if txnresp.Succeeded { - return txnresp - } - // load prefetch with Else data - for i := range keys { - resp := txnresp.Responses[i].GetResponseRange() - s.rset[keys[i]] = (*v3.GetResponse)(resp) - } - s.prefetch = s.rset - s.getOpts = nil - return nil -} - -func isKeyCurrent(k string, r *v3.GetResponse) v3.Cmp { - rev := r.Header.Revision + 1 - if len(r.Kvs) != 0 { - rev = r.Kvs[0].ModRevision + 1 - } - return v3.Compare(v3.ModRevision(k), "<", rev) -} - -func respToValue(resp *v3.GetResponse) string { - if len(resp.Kvs) == 0 { - return "" - } - return string(resp.Kvs[0].Value) -} diff --git a/vendor/github.com/coreos/etcd/clientv3/integration/doc.go b/vendor/github.com/coreos/etcd/clientv3/integration/doc.go deleted file mode 100644 index 7e3a1ccec60..00000000000 --- a/vendor/github.com/coreos/etcd/clientv3/integration/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 CoreOS, Inc. -// -// 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 integration implements tests built upon embedded etcd, and focuses on -// correctness of etcd client. -package integration diff --git a/vendor/github.com/coreos/etcd/clientv3/mirror/syncer.go b/vendor/github.com/coreos/etcd/clientv3/mirror/syncer.go deleted file mode 100644 index cb2cf64a2b6..00000000000 --- a/vendor/github.com/coreos/etcd/clientv3/mirror/syncer.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2016 CoreOS, Inc. -// -// 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 mirror implements etcd mirroring operations. -package mirror - -import ( - "github.com/coreos/etcd/clientv3" - "golang.org/x/net/context" -) - -const ( - batchLimit = 1000 -) - -// Syncer syncs with the key-value state of an etcd cluster. -type Syncer interface { - // SyncBase syncs the base state of the key-value state. - // The key-value state are sent through the returned chan. - SyncBase(ctx context.Context) (<-chan clientv3.GetResponse, chan error) - // SyncUpdates syncs the updates of the key-value state. - // The update events are sent through the returned chan. - SyncUpdates(ctx context.Context) clientv3.WatchChan -} - -// NewSyncer creates a Syncer. -func NewSyncer(c *clientv3.Client, prefix string, rev int64) Syncer { - return &syncer{c: c, prefix: prefix, rev: rev} -} - -type syncer struct { - c *clientv3.Client - rev int64 - prefix string -} - -func (s *syncer) SyncBase(ctx context.Context) (<-chan clientv3.GetResponse, chan error) { - respchan := make(chan clientv3.GetResponse, 1024) - errchan := make(chan error, 1) - - // if rev is not specified, we will choose the most recent revision. - if s.rev == 0 { - resp, err := s.c.Get(ctx, "foo") - if err != nil { - errchan <- err - close(respchan) - close(errchan) - return respchan, errchan - } - s.rev = resp.Header.Revision - } - - go func() { - defer close(respchan) - defer close(errchan) - - var key string - - opts := []clientv3.OpOption{clientv3.WithLimit(batchLimit), clientv3.WithRev(s.rev)} - - if len(s.prefix) == 0 { - // If len(s.prefix) == 0, we will sync the entire key-value space. - // We then range from the smallest key (0x00) to the end. - opts = append(opts, clientv3.WithFromKey()) - key = "\x00" - } else { - // If len(s.prefix) != 0, we will sync key-value space with given prefix. - // We then range from the prefix to the next prefix if exists. Or we will - // range from the prefix to the end if the next prefix does not exists. - opts = append(opts, clientv3.WithPrefix()) - key = s.prefix - } - - for { - resp, err := s.c.Get(ctx, key, opts...) - if err != nil { - errchan <- err - return - } - - respchan <- (clientv3.GetResponse)(*resp) - - if !resp.More { - return - } - // move to next key - key = string(append(resp.Kvs[len(resp.Kvs)-1].Key, 0)) - } - }() - - return respchan, errchan -} - -func (s *syncer) SyncUpdates(ctx context.Context) clientv3.WatchChan { - if s.rev == 0 { - panic("unexpected revision = 0. Calling SyncUpdates before SyncBase finishes?") - } - return s.c.Watch(ctx, s.prefix, clientv3.WithPrefix(), clientv3.WithRev(s.rev+1)) -} diff --git a/vendor/github.com/coreos/etcd/integration/fixtures/ca.crt b/vendor/github.com/coreos/etcd/integration/fixtures/ca.crt deleted file mode 100644 index 200b1b26064..00000000000 --- a/vendor/github.com/coreos/etcd/integration/fixtures/ca.crt +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICHTCCAaOgAwIBAgIUBFn+GT3FJV5W6SD+tn/L9cxT8rkwCgYIKoZIzj0EAwMw -PDEMMAoGA1UEBhMDVVNBMRAwDgYDVQQKEwdldGNkLWNhMQswCQYDVQQLEwJDQTEN -MAsGA1UEAxMEZXRjZDAeFw0xNjAyMDkyMzI5MDBaFw0yNjAyMDYyMzI5MDBaMDwx -DDAKBgNVBAYTA1VTQTEQMA4GA1UEChMHZXRjZC1jYTELMAkGA1UECxMCQ0ExDTAL -BgNVBAMTBGV0Y2QwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAT6FqAyCl0a7/XNtDUP -fzBRDFifDRnwNmKvbTiNMrgnx9ASJsDIsMMPJwa7A/ZIeu7SYD+UI9pejVwP/IBe -XknlozxDBq2kmV0o5tHTw7E460TqXy8aW1f+P97Ty23jOlOjZjBkMA4GA1UdDwEB -/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgECMB0GA1UdDgQWBBSz5VY1yFxMp0jk -JCm1esngW7dShzAfBgNVHSMEGDAWgBSz5VY1yFxMp0jkJCm1esngW7dShzAKBggq -hkjOPQQDAwNoADBlAjEAjq9EUW5JaALRd1xV6q518ju3RxdKZY61HTcxL6u5wFpb -EAMR/KoZpkLYFpGr3KtzAjAriAQYdZ1BNzYi2sckOctLUg/I97Ybs8kmX7MFaFmd -e7zXUO7ahhQNPXnWrn82u7A= ------END CERTIFICATE----- diff --git a/vendor/github.com/coreos/etcd/integration/fixtures/server.crt b/vendor/github.com/coreos/etcd/integration/fixtures/server.crt deleted file mode 100644 index cc8357e1342..00000000000 --- a/vendor/github.com/coreos/etcd/integration/fixtures/server.crt +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICZzCCAe2gAwIBAgIURBvYzg73AkmCGaCgUUaEHfSoyF0wCgYIKoZIzj0EAwMw -PDEMMAoGA1UEBhMDVVNBMRAwDgYDVQQKEwdldGNkLWNhMQswCQYDVQQLEwJDQTEN -MAsGA1UEAxMEZXRjZDAeFw0xNjAyMDkyMzI5MDBaFw0yNjAyMDYyMzI5MDBaME8x -EDAOBgNVBAoTB2V0Y2QtY2ExEDAOBgNVBAsTB3NlcnZlcjExFTATBgNVBAcTDHRo -ZSBpbnRlcm5ldDESMBAGA1UEAxMJbG9jYWxob3N0MHYwEAYHKoZIzj0CAQYFK4EE -ACIDYgAEdI0oCEWEj9ztcCHVwn34HK0TElsdsTlfJ9sDZ20GO9HN9/hfKgoHlCXE -sK5H4WNT8E6q2q8PD9bpEtYiW82Q8/wJUmQrFIf0uxMrOUVbNGPQo6woDJr/uM8V -jRGkOW2qo4GcMIGZMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcD -AQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUZzeCN+kAdg73qiHy -MT4+D851T5UwHwYDVR0jBBgwFoAUs+VWNchcTKdI5CQptXrJ4Fu3UocwGgYDVR0R -BBMwEYIJbG9jYWxob3N0hwR/AAABMAoGCCqGSM49BAMDA2gAMGUCMGW8jAlBWNqO -q7Gp2gCIHgl1xlXPppuPRnSwhU1xsPnjgHeblWygyVI2IFAVUZLEvgIxAO8OR6Cl -eN+rNGqrJAOv3+YVkDm5teDkW9N48P0RIp1TdXQIeGBhYhA0J+de6YulIQ== ------END CERTIFICATE----- diff --git a/vendor/github.com/coreos/etcd/integration/fixtures/server.key.insecure b/vendor/github.com/coreos/etcd/integration/fixtures/server.key.insecure deleted file mode 100644 index 631f398cec6..00000000000 --- a/vendor/github.com/coreos/etcd/integration/fixtures/server.key.insecure +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MIGkAgEBBDDcUDqtGAt72T44c44iAFxP8cqJ/Hz4IbPrd4IoE4nBY+s6q+XCgtNa -hl5RW7I075qgBwYFK4EEACKhZANiAAR0jSgIRYSP3O1wIdXCffgcrRMSWx2xOV8n -2wNnbQY70c33+F8qCgeUJcSwrkfhY1PwTqrarw8P1ukS1iJbzZDz/AlSZCsUh/S7 -Eys5RVs0Y9CjrCgMmv+4zxWNEaQ5bao= ------END EC PRIVATE KEY----- diff --git a/vendor/github.com/coreos/etcd/raft/rafttest/doc.go b/vendor/github.com/coreos/etcd/raft/rafttest/doc.go deleted file mode 100644 index 85ef5e7ffe9..00000000000 --- a/vendor/github.com/coreos/etcd/raft/rafttest/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// 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 rafttest provides functional tests for etcd's raft implementation. -package rafttest diff --git a/vendor/github.com/coreos/etcd/raft/rafttest/network.go b/vendor/github.com/coreos/etcd/raft/rafttest/network.go deleted file mode 100644 index 1bc6fd988da..00000000000 --- a/vendor/github.com/coreos/etcd/raft/rafttest/network.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// 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 rafttest - -import ( - "math/rand" - "sync" - "time" - - "github.com/coreos/etcd/raft/raftpb" -) - -// a network interface -type iface interface { - send(m raftpb.Message) - recv() chan raftpb.Message - disconnect() - connect() -} - -// a network -type network interface { - // drop message at given rate (1.0 drops all messages) - drop(from, to uint64, rate float64) - // delay message for (0, d] randomly at given rate (1.0 delay all messages) - // do we need rate here? - delay(from, to uint64, d time.Duration, rate float64) - disconnect(id uint64) - connect(id uint64) - // heal heals the network - heal() -} - -type raftNetwork struct { - mu sync.Mutex - disconnected map[uint64]bool - dropmap map[conn]float64 - delaymap map[conn]delay - recvQueues map[uint64]chan raftpb.Message -} - -type conn struct { - from, to uint64 -} - -type delay struct { - d time.Duration - rate float64 -} - -func newRaftNetwork(nodes ...uint64) *raftNetwork { - pn := &raftNetwork{ - recvQueues: make(map[uint64]chan raftpb.Message), - dropmap: make(map[conn]float64), - delaymap: make(map[conn]delay), - disconnected: make(map[uint64]bool), - } - - for _, n := range nodes { - pn.recvQueues[n] = make(chan raftpb.Message, 1024) - } - return pn -} - -func (rn *raftNetwork) nodeNetwork(id uint64) iface { - return &nodeNetwork{id: id, raftNetwork: rn} -} - -func (rn *raftNetwork) send(m raftpb.Message) { - rn.mu.Lock() - to := rn.recvQueues[m.To] - if rn.disconnected[m.To] { - to = nil - } - drop := rn.dropmap[conn{m.From, m.To}] - dl := rn.delaymap[conn{m.From, m.To}] - rn.mu.Unlock() - - if to == nil { - return - } - if drop != 0 && rand.Float64() < drop { - return - } - // TODO: shall we dl without blocking the send call? - if dl.d != 0 && rand.Float64() < dl.rate { - rd := rand.Int63n(int64(dl.d)) - time.Sleep(time.Duration(rd)) - } - - select { - case to <- m: - default: - // drop messages when the receiver queue is full. - } -} - -func (rn *raftNetwork) recvFrom(from uint64) chan raftpb.Message { - rn.mu.Lock() - fromc := rn.recvQueues[from] - if rn.disconnected[from] { - fromc = nil - } - rn.mu.Unlock() - - return fromc -} - -func (rn *raftNetwork) drop(from, to uint64, rate float64) { - rn.mu.Lock() - defer rn.mu.Unlock() - rn.dropmap[conn{from, to}] = rate -} - -func (rn *raftNetwork) delay(from, to uint64, d time.Duration, rate float64) { - rn.mu.Lock() - defer rn.mu.Unlock() - rn.delaymap[conn{from, to}] = delay{d, rate} -} - -func (rn *raftNetwork) heal() { - rn.mu.Lock() - defer rn.mu.Unlock() - rn.dropmap = make(map[conn]float64) - rn.delaymap = make(map[conn]delay) -} - -func (rn *raftNetwork) disconnect(id uint64) { - rn.mu.Lock() - defer rn.mu.Unlock() - rn.disconnected[id] = true -} - -func (rn *raftNetwork) connect(id uint64) { - rn.mu.Lock() - defer rn.mu.Unlock() - rn.disconnected[id] = false -} - -type nodeNetwork struct { - id uint64 - *raftNetwork -} - -func (nt *nodeNetwork) connect() { - nt.raftNetwork.connect(nt.id) -} - -func (nt *nodeNetwork) disconnect() { - nt.raftNetwork.disconnect(nt.id) -} - -func (nt *nodeNetwork) send(m raftpb.Message) { - nt.raftNetwork.send(m) -} - -func (nt *nodeNetwork) recv() chan raftpb.Message { - return nt.recvFrom(nt.id) -} diff --git a/vendor/github.com/coreos/etcd/raft/rafttest/node.go b/vendor/github.com/coreos/etcd/raft/rafttest/node.go deleted file mode 100644 index 72f30f0d48f..00000000000 --- a/vendor/github.com/coreos/etcd/raft/rafttest/node.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// 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 rafttest - -import ( - "log" - "time" - - "github.com/coreos/etcd/raft" - "github.com/coreos/etcd/raft/raftpb" - "golang.org/x/net/context" -) - -type node struct { - raft.Node - id uint64 - iface iface - stopc chan struct{} - pausec chan bool - - // stable - storage *raft.MemoryStorage - state raftpb.HardState -} - -func startNode(id uint64, peers []raft.Peer, iface iface) *node { - st := raft.NewMemoryStorage() - c := &raft.Config{ - ID: id, - ElectionTick: 10, - HeartbeatTick: 1, - Storage: st, - MaxSizePerMsg: 1024 * 1024, - MaxInflightMsgs: 256, - } - rn := raft.StartNode(c, peers) - n := &node{ - Node: rn, - id: id, - storage: st, - iface: iface, - pausec: make(chan bool), - } - n.start() - return n -} - -func (n *node) start() { - n.stopc = make(chan struct{}) - ticker := time.Tick(5 * time.Millisecond) - - go func() { - for { - select { - case <-ticker: - n.Tick() - case rd := <-n.Ready(): - if !raft.IsEmptyHardState(rd.HardState) { - n.state = rd.HardState - n.storage.SetHardState(n.state) - } - n.storage.Append(rd.Entries) - time.Sleep(time.Millisecond) - // TODO: make send async, more like real world... - for _, m := range rd.Messages { - n.iface.send(m) - } - n.Advance() - case m := <-n.iface.recv(): - n.Step(context.TODO(), m) - case <-n.stopc: - n.Stop() - log.Printf("raft.%d: stop", n.id) - n.Node = nil - close(n.stopc) - return - case p := <-n.pausec: - recvms := make([]raftpb.Message, 0) - for p { - select { - case m := <-n.iface.recv(): - recvms = append(recvms, m) - case p = <-n.pausec: - } - } - // step all pending messages - for _, m := range recvms { - n.Step(context.TODO(), m) - } - } - } - }() -} - -// stop stops the node. stop a stopped node might panic. -// All in memory state of node is discarded. -// All stable MUST be unchanged. -func (n *node) stop() { - n.iface.disconnect() - n.stopc <- struct{}{} - // wait for the shutdown - <-n.stopc -} - -// restart restarts the node. restart a started node -// blocks and might affect the future stop operation. -func (n *node) restart() { - // wait for the shutdown - <-n.stopc - c := &raft.Config{ - ID: n.id, - ElectionTick: 10, - HeartbeatTick: 1, - Storage: n.storage, - MaxSizePerMsg: 1024 * 1024, - MaxInflightMsgs: 256, - } - n.Node = raft.RestartNode(c) - n.start() - n.iface.connect() -} - -// pause pauses the node. -// The paused node buffers the received messages and replies -// all of them when it resumes. -func (n *node) pause() { - n.pausec <- true -} - -// resume resumes the paused node. -func (n *node) resume() { - n.pausec <- false -} diff --git a/vendor/github.com/coreos/pkg/capnslog/example/hello_dolly.go b/vendor/github.com/coreos/pkg/capnslog/example/hello_dolly.go deleted file mode 100644 index cd1b8f82510..00000000000 --- a/vendor/github.com/coreos/pkg/capnslog/example/hello_dolly.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2015 CoreOS, Inc. -// -// 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 ( - "flag" - oldlog "log" - "os" - - "github.com/coreos/pkg/capnslog" -) - -var logLevel = capnslog.INFO -var log = capnslog.NewPackageLogger("github.com/coreos/pkg/capnslog/cmd", "main") -var dlog = capnslog.NewPackageLogger("github.com/coreos/pkg/capnslog/cmd", "dolly") - -func init() { - flag.Var(&logLevel, "log-level", "Global log level.") -} - -func main() { - rl := capnslog.MustRepoLogger("github.com/coreos/pkg/capnslog/cmd") - capnslog.SetFormatter(capnslog.NewStringFormatter(os.Stderr)) - - // We can parse the log level configs from the command line - flag.Parse() - if flag.NArg() > 1 { - cfg, err := rl.ParseLogLevelConfig(flag.Arg(1)) - if err != nil { - log.Fatal(err) - } - rl.SetLogLevel(cfg) - log.Infof("Setting output to %s", flag.Arg(1)) - } - - // Send some messages at different levels to the different packages - dlog.Infof("Hello Dolly") - dlog.Warningf("Well hello, Dolly") - log.Errorf("It's so nice to have you back where you belong") - dlog.Debugf("You're looking swell, Dolly") - dlog.Tracef("I can tell, Dolly") - - // We also have control over the built-in "log" package. - capnslog.SetGlobalLogLevel(logLevel) - oldlog.Println("You're still glowin', you're still crowin', you're still lookin' strong") - log.Fatalf("Dolly'll never go away again") -} diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/cni/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/cni/LICENSE deleted file mode 100644 index 8f71f43fee3..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/cni/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/rkt/Godeps/_workspace/src/github.com/appc/docker2aci/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/docker2aci/LICENSE deleted file mode 100644 index e06d2081865..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/docker2aci/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/rkt/Godeps/_workspace/src/github.com/appc/goaci/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/goaci/LICENSE deleted file mode 100644 index e06d2081865..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/goaci/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/rkt/Godeps/_workspace/src/github.com/appc/spec/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/LICENSE deleted file mode 100644 index e06d2081865..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/COPYING b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/COPYING deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/COPYING +++ /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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/clients/chrome/clip-it-good/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/clients/chrome/clip-it-good/LICENSE deleted file mode 100644 index 055361b34f5..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/clients/chrome/clip-it-good/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2010 Brett Slatkin - -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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/misc/copyrightifity b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/misc/copyrightifity deleted file mode 100644 index 14db513c884..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/misc/copyrightifity +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -# -# Copyright 2010 Google Inc. -# -# 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 script adds copyright headers to files. - -use strict; -my $header = do { local $/; }; -$header =~ s!\s+$!\n!; -my $yyyy = (localtime())[5] + 1900; -$header =~ s/YYYY/$yyyy/ or die; - -unless (@ARGV == 1) { - die "Usage: copyrightify \n"; -} - -my $file = shift; -open(my $fh, $file) or die "Open $file error: $!\n"; -my $source = do { local $/; <$fh> }; -close($fh); -if ($source =~ /Copyright \d\d\d\d/) { - print STDERR "# $file - OK\n"; - exit; -} - -my $newsource = $source; -if ($file =~ /\.(go|java|aidl)$/) { - $header = "/*\n$header*/\n\n"; - $newsource = $header . $source; -} elsif ($file =~ /\.py$/) { - $header = join("", map { "# $_\n" } split(/\n/, $header)); - $newsource = $header . $source; -} else { - die "File type not supported."; -} - - -open(my $fh, ">$file") or die "Open $file error: $!\n"; -print $fh $newsource; -close($fh) or die; - -__END__ -Copyright YYYY The Camlistore 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/pkg/legal/legal.go b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/pkg/legal/legal.go deleted file mode 100644 index a75283fd6bc..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/pkg/legal/legal.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2014 The Camlistore 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. -*/ - -// Package legal provides project-wide storage for compiled-in licenses. -package legal - -var licenses []string - -func init() { - RegisterLicense(` -Copyright 2014 The Camlistore 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. -`) -} - -// RegisterLicense stores the license text. -// It doesn't check whether the text was already present. -func RegisterLicense(text string) { - licenses = append(licenses, text) - return -} - -// Licenses returns a slice of the licenses. -func Licenses() []string { - return licenses -} diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/pkg/legal/legalprint/legalprint.go b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/pkg/legal/legalprint/legalprint.go deleted file mode 100644 index e4a3205a6ac..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/pkg/legal/legalprint/legalprint.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2014 The Camlistore 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. -*/ - -// Package legalprint provides a printing helper for the legal package. -package legalprint - -import ( - "flag" - "fmt" - "io" - - "camlistore.org/pkg/legal" -) - -var ( - flagLegal = flag.Bool("legal", false, "show licenses") -) - -// MaybePrint will print the licenses if flagLegal has been set. -// It will return the value of the flagLegal. -func MaybePrint(out io.Writer) bool { - if !*flagLegal { - return false - } - for _, text := range legal.Licenses() { - fmt.Fprintln(out, text) - } - return true -} diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/bazil.org/fuse/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/bazil.org/fuse/LICENSE deleted file mode 100644 index d369cb822a4..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/bazil.org/fuse/LICENSE +++ /dev/null @@ -1,93 +0,0 @@ -Copyright (c) 2013, 2014 Tommi Virtanen. -Copyright (c) 2009, 2011, 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. - - - -The following included software components have additional copyright -notices and license terms that may differ from the above. - - -File fuse.go: - -// Adapted from Plan 9 from User Space's src/cmd/9pfuse/fuse.c, -// which carries this notice: -// -// The files in this directory are subject to the following license. -// -// The author of this software is Russ Cox. -// -// Copyright (c) 2006 Russ Cox -// -// Permission to use, copy, modify, and distribute this software for any -// purpose without fee is hereby granted, provided that this entire notice -// is included in all copies of any software which is or includes a copy -// or modification of this software and in all copies of the supporting -// documentation for such software. -// -// THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED -// WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION OR WARRANTY -// OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS -// FITNESS FOR ANY PARTICULAR PURPOSE. - - -File fuse_kernel.go: - -// Derived from FUSE's fuse_kernel.h -/* - This file defines the kernel interface of FUSE - Copyright (C) 2001-2007 Miklos Szeredi - - - This -- and only this -- header file may also be distributed under - the terms of the BSD Licence as follows: - - Copyright (C) 2001-2007 Miklos Szeredi. 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 AUTHOR 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 AUTHOR 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/closure/lib/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/closure/lib/LICENSE deleted file mode 100644 index d9a10c0d8e8..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/closure/lib/LICENSE +++ /dev/null @@ -1,176 +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 diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/goauth2/PATENTS b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/goauth2/PATENTS deleted file mode 100644 index 9e8716353d8..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/goauth2/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 goauth2 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/leveldb-go/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/leveldb-go/LICENSE deleted file mode 100644 index fec05ce1295..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/leveldb-go/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 The LevelDB-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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/snappy-go/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/snappy-go/LICENSE deleted file mode 100644 index 6050c10f4c8..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/snappy-go/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 The Snappy-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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/xsrftoken/COPYING b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/xsrftoken/COPYING deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/xsrftoken/COPYING +++ /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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/fontawesome/LICENSE.txt b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/fontawesome/LICENSE.txt deleted file mode 100644 index 1066d2f8259..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/fontawesome/LICENSE.txt +++ /dev/null @@ -1,4 +0,0 @@ -fonts/*: SIL OFL 1.1 (http://scripts.sil.org/OFL) -css/*: MIT (http://opensource.org/licenses/mit-license.html) - -Details at http://fortawesome.github.io/Font-Awesome/license/ diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/camlistore/lock/COPYING b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/camlistore/lock/COPYING deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/camlistore/lock/COPYING +++ /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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/exp/dbm/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/exp/dbm/LICENSE deleted file mode 100644 index 65d761bc9f2..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/exp/dbm/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/exp/lldb/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/exp/lldb/LICENSE deleted file mode 100644 index 65d761bc9f2..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/exp/lldb/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/LICENSE deleted file mode 100644 index 50bbdd2410f..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The fileutil 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/falloc/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/falloc/LICENSE deleted file mode 100644 index 1e92e33dd70..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/falloc/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 CZ.NIC z.s.p.o. 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 CZ.NIC 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/hdb/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/hdb/LICENSE deleted file mode 100644 index 1e92e33dd70..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/hdb/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 CZ.NIC z.s.p.o. 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 CZ.NIC 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/storage/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/storage/LICENSE deleted file mode 100644 index 1e92e33dd70..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/fileutil/storage/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 CZ.NIC z.s.p.o. 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 CZ.NIC 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/kv/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/kv/LICENSE deleted file mode 100644 index 65d761bc9f2..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/kv/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/mathutil/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/mathutil/LICENSE deleted file mode 100644 index 1e92e33dd70..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/mathutil/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 CZ.NIC z.s.p.o. 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 CZ.NIC 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/mathutil/mersenne/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/mathutil/mersenne/LICENSE deleted file mode 100644 index 7150ce3e437..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/mathutil/mersenne/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 jnml. 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 jnml nor the names of his -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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/sortutil/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/sortutil/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/sortutil/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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/zappy/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/zappy/LICENSE deleted file mode 100644 index 65d761bc9f2..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/cznic/zappy/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/davecgh/go-spew/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/davecgh/go-spew/LICENSE deleted file mode 100644 index 2a7cfd2bf6a..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/davecgh/go-spew/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2012-2013 Dave Collins - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/go-sql-driver/mysql/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/go-sql-driver/mysql/LICENSE deleted file mode 100644 index 14e2f777f6c..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/go-sql-driver/mysql/LICENSE +++ /dev/null @@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/golang/glog/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/golang/glog/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/gorilla/websocket/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/gorilla/websocket/LICENSE deleted file mode 100644 index 09e5be61d79..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/gorilla/websocket/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2013, Gorilla web toolkit -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. - -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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/lib/pq/LICENSE.md b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/lib/pq/LICENSE.md deleted file mode 100644 index 5773904a30e..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/lib/pq/LICENSE.md +++ /dev/null @@ -1,8 +0,0 @@ -Copyright (c) 2011-2013, 'pq' Contributors -Portions Copyright (C) 2011 Blake Mizerany - -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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/russross/blackfriday/LICENSE.txt b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/russross/blackfriday/LICENSE.txt deleted file mode 100644 index 2885af3602d..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/rwcarlsen/goexif/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/rwcarlsen/goexif/LICENSE deleted file mode 100644 index aa6250465fe..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/github.com/rwcarlsen/goexif/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ - -Copyright (c) 2012, Robert Carlsen & Contributors -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. - -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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/glitch/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/glitch/LICENSE deleted file mode 100644 index 7efba3b1c6b..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/glitch/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -The files in here come from www.glitchthegame.com. - -License here: http://www.glitchthegame.com/public-domain-game-art/#licensing - -All files are provided by Tiny Speck under the Creative Commons CC0 1.0 -Universal License. This is a broadly permissive "No Rights Reserved" license — -you may do what you please with what we've provided. Our intention is to -dedicate these works to the public domain and make them freely available to all, -without restriction. All files are provided AS-IS. Tiny Speck cannot provide any -support to help you bring these assets into your own projects. - -Note: the Glitch logo and trademark are not among the things we are making -available under this license. Only items in the files explicitly included herein -are covered. - -There is no obligation to link or credit the works, but if you do, please link -to glitchthegame.com, our permanent "retirement" site for the game and these -assets. Of course, links/shoutouts to Tiny Speck (tinyspeck.com) and/or Slack -(slack.com) are appreciated. diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/golang.org/x/image/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/golang.org/x/image/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/golang.org/x/image/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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/golang.org/x/image/PATENTS b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/golang.org/x/image/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/golang.org/x/image/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/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/labix.org/v2/mgo/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/labix.org/v2/mgo/LICENSE deleted file mode 100644 index 770c7672b45..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/labix.org/v2/mgo/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -mgo - MongoDB driver 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/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/labix.org/v2/mgo/bson/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/labix.org/v2/mgo/bson/LICENSE deleted file mode 100644 index 890326017b8..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/labix.org/v2/mgo/bson/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -BSON library for Go - -Copyright (c) 2010-2012 - 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/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/react/LICENSE.txt b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/react/LICENSE.txt deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/react/LICENSE.txt +++ /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/rkt/Godeps/_workspace/src/github.com/camlistore/go4/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/go4/LICENSE deleted file mode 100644 index 8f71f43fee3..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/go4/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/rkt/Godeps/_workspace/src/github.com/camlistore/go4/legal/legal.go b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/go4/legal/legal.go deleted file mode 100644 index de9ae9c8589..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/go4/legal/legal.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2014 The Go4 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. -*/ - -// Package legal provides in-process storage for compiled-in licenses. -package legal - -var licenses []string - -// RegisterLicense stores the license text. -// It doesn't check whether the text was already present. -func RegisterLicense(text string) { - licenses = append(licenses, text) - return -} - -// Licenses returns a slice of the licenses. -func Licenses() []string { - return licenses -} diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/gexpect/LICENCE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/gexpect/LICENCE deleted file mode 100644 index 50adb0f19c8..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/coreos/go-iptables/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/go-iptables/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/go-iptables/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/rkt/Godeps/_workspace/src/github.com/coreos/go-semver/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/go-semver/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/go-semver/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/rkt/Godeps/_workspace/src/github.com/coreos/go-systemd/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/go-systemd/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/go-systemd/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/rkt/Godeps/_workspace/src/github.com/coreos/go-tspi/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/go-tspi/LICENSE deleted file mode 100644 index e06d2081865..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/go-tspi/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/rkt/Godeps/_workspace/src/github.com/coreos/ioprogress/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/ioprogress/LICENSE deleted file mode 100644 index 22985159044..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/coreos/ioprogress/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mitchell Hashimoto - -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/rkt/Godeps/_workspace/src/github.com/cpuguy83/go-md2man/LICENSE.md b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cpuguy83/go-md2man/LICENSE.md deleted file mode 100644 index 1cade6cef6a..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/cznic/b/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/b/LICENSE deleted file mode 100644 index 54c6e90872f..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/b/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The b 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/bufs/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/bufs/LICENSE deleted file mode 100644 index 7d80fe28eb1..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/bufs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The bufs 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/exp/dbm/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/exp/dbm/LICENSE deleted file mode 100644 index 80c7ae7fa60..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/exp/dbm/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The dbm 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/exp/lldb/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/exp/lldb/LICENSE deleted file mode 100644 index 27e4447a49f..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/exp/lldb/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The lldb 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/LICENSE deleted file mode 100644 index 50bbdd2410f..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The fileutil 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/falloc/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/falloc/LICENSE deleted file mode 100644 index 1e92e33dd70..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/falloc/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 CZ.NIC z.s.p.o. 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 CZ.NIC 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/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/hdb/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/hdb/LICENSE deleted file mode 100644 index 1e92e33dd70..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/hdb/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 CZ.NIC z.s.p.o. 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 CZ.NIC 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/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/storage/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/storage/LICENSE deleted file mode 100644 index 1e92e33dd70..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/fileutil/storage/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 CZ.NIC z.s.p.o. 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 CZ.NIC 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/rkt/Godeps/_workspace/src/github.com/cznic/mathutil/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/mathutil/LICENSE deleted file mode 100644 index 128a1b64a48..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/mathutil/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The mathutil 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/mathutil/mersenne/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/mathutil/mersenne/LICENSE deleted file mode 100644 index 4fa2a1f4fdb..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/mathutil/mersenne/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The mersenne 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/ql/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/ql/LICENSE deleted file mode 100644 index 0d10c02b92e..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/ql/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The ql 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/sortutil/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/sortutil/LICENSE deleted file mode 100644 index 67983e0e618..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/sortutil/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The sortutil 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/strutil/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/strutil/LICENSE deleted file mode 100644 index 2fdd92cf713..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/strutil/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The strutil 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/cznic/zappy/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/zappy/LICENSE deleted file mode 100644 index bc67059c529..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/cznic/zappy/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014 The zappy 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 names of the authors nor the names of the -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/rkt/Godeps/_workspace/src/github.com/d2g/dhcp4/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/d2g/dhcp4/LICENSE deleted file mode 100644 index f7d058a3586..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/d2g/dhcp4/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 Skagerrak Software Limited. 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 Skagerrak Software Limited 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. \ No newline at end of file diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/d2g/dhcp4client/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/d2g/dhcp4client/LICENSE deleted file mode 100644 index c33dcc7c928..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/d2g/dhcp4client/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. “Contributor” - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. “Contributor Version” - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - - means Covered Software of a particular Contributor. - -1.4. “Covered Software” - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. “Incompatible With Secondary Licenses” - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. “Executable Form” - - means any form of the work other than Source Code Form. - -1.7. “Larger Work” - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. “License” - - means this document. - -1.9. “Licensable” - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. “Modifications” - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. “Secondary License” - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - - means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, “control” means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipients’ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - party’s negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/docker/distribution/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/docker/distribution/LICENSE deleted file mode 100644 index e06d2081865..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/docker/distribution/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/rkt/Godeps/_workspace/src/github.com/dustin/go-humanize/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/dustin/go-humanize/LICENSE deleted file mode 100644 index 8d9a94a9068..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/dustin/go-humanize/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2005-2008 Dustin Sallings - -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/rkt/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE deleted file mode 100644 index 670d88fcaaf..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2013, Georg Reinke (), Google -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/rkt/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE deleted file mode 100644 index 1b1b1921efa..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/google/btree/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/google/btree/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/gorilla/context/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/gorilla/context/LICENSE deleted file mode 100644 index 0e5fb872800..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/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/coreos/rkt/Godeps/_workspace/src/github.com/gorilla/mux/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/gorilla/mux/LICENSE deleted file mode 100644 index 0e5fb872800..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/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/coreos/rkt/Godeps/_workspace/src/github.com/hashicorp/errwrap/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/hashicorp/errwrap/LICENSE deleted file mode 100644 index c33dcc7c928..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/hashicorp/errwrap/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. “Contributor” - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. “Contributor Version” - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - - means Covered Software of a particular Contributor. - -1.4. “Covered Software” - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. “Incompatible With Secondary Licenses” - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. “Executable Form” - - means any form of the work other than Source Code Form. - -1.7. “Larger Work” - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. “License” - - means this document. - -1.9. “Licensable” - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. “Modifications” - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. “Secondary License” - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - - means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, “control” means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipients’ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - party’s negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/hydrogen18/stoppableListener/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/hydrogen18/stoppableListener/LICENSE deleted file mode 100644 index efcb2414a33..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/hydrogen18/stoppableListener/LICENSE +++ /dev/null @@ -1,10 +0,0 @@ -Copyright (c) 2014, Eric Urban -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. \ No newline at end of file diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/inconshreveable/mousetrap/LICENSE deleted file mode 100644 index 5f0d1fb6a7b..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/kballard/go-shellquote/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/kballard/go-shellquote/LICENSE deleted file mode 100644 index a6d77312e10..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/kr/pty/License b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/kr/pty/License deleted file mode 100644 index 6b7558b6b42..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE deleted file mode 100644 index 5dc68268d90..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009,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/rkt/Godeps/_workspace/src/github.com/petar/GoLLRB/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/petar/GoLLRB/LICENSE deleted file mode 100644 index b75312c787d..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/petar/GoLLRB/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2010, Petar Maymounkov -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 Petar Maymounkov 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. diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/peterbourgon/diskv/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/peterbourgon/diskv/LICENSE deleted file mode 100644 index 41ce7f16e1d..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/peterbourgon/diskv/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2011-2012 Peter Bourgon - -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/rkt/Godeps/_workspace/src/github.com/russross/blackfriday/LICENSE.txt b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/russross/blackfriday/LICENSE.txt deleted file mode 100644 index 2885af3602d..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/shurcooL/sanitized_anchor_name/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/shurcooL/sanitized_anchor_name/LICENSE deleted file mode 100644 index 5f4e3ed57a0..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/spf13/cobra/LICENSE.txt deleted file mode 100644 index 298f0e2665e..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/licenses.go b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/spf13/cobra/cobra/cmd/licenses.go deleted file mode 100644 index 5ad9c96ef18..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE deleted file mode 100644 index 63ed1cfea1f..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/github.com/syndtr/gocapability/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/syndtr/gocapability/LICENSE deleted file mode 100644 index 80dd96de77f..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/syndtr/gocapability/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2013 Suryandaru Triandana -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. - -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/rkt/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE deleted file mode 100644 index 9f64db8582c..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE +++ /dev/null @@ -1,192 +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 2014 Vishvananda Ishaya. - Copyright 2014 Docker, Inc. - - 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/rkt/Godeps/_workspace/src/golang.org/x/crypto/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/crypto/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/coreos/rkt/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/coreos/rkt/Godeps/_workspace/src/golang.org/x/crypto/PATENTS b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/crypto/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/github.com/coreos/rkt/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/coreos/rkt/Godeps/_workspace/src/golang.org/x/net/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/net/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/golang.org/x/net/PATENTS b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/net/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/golang.org/x/sys/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/sys/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/sys/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/rkt/Godeps/_workspace/src/golang.org/x/sys/PATENTS b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/sys/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/sys/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/rkt/Godeps/_workspace/src/golang.org/x/tools/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/tools/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/tools/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/rkt/Godeps/_workspace/src/golang.org/x/tools/PATENTS b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/tools/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/golang.org/x/tools/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/rkt/Godeps/_workspace/src/google.golang.org/grpc/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/google.golang.org/grpc/LICENSE deleted file mode 100644 index f4988b45079..00000000000 --- a/vendor/github.com/coreos/rkt/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/rkt/Godeps/_workspace/src/google.golang.org/grpc/PATENTS b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/google.golang.org/grpc/PATENTS deleted file mode 100644 index 619f9dbfe63..00000000000 --- a/vendor/github.com/coreos/rkt/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/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/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/rkt/Godeps/_workspace/src/k8s.io/kubernetes/examples/update-demo/local/LICENSE.angular b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/examples/update-demo/local/LICENSE.angular deleted file mode 100644 index 020f87acd2e..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/examples/update-demo/local/LICENSE.angular +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2010-2014 Google, Inc. http://angularjs.org - -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/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/LICENSE deleted file mode 100644 index 74487567632..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/PATENTS b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/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/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/htpasswd/COPYING b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/htpasswd/COPYING deleted file mode 100644 index c6b097c0168..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/htpasswd/COPYING +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (C) 2003-2013 Edgewall Software -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/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/pause/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/pause/LICENSE deleted file mode 100644 index 2b5e5ff1ab5..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/pause/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -The Expat/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/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/swagger-ui/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/swagger-ui/LICENSE deleted file mode 100644 index 9f93e067e8e..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/k8s.io/kubernetes/third_party/swagger-ui/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -Copyright 2014 Reverb Technologies, Inc. - -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 [apache.org/licenses/LICENSE-2.0](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/rkt/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf/LICENSE b/vendor/github.com/coreos/rkt/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf/LICENSE deleted file mode 100644 index efa1aa1896a..00000000000 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf/LICENSE +++ /dev/null @@ -1,57 +0,0 @@ -Copyright (c) 2012 Péter Surányi. 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. - -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. - ----------------------------------------------------------------------- -Portions of inf.Dec's source code have been derived from Go and are -covered by the following license: ----------------------------------------------------------------------- - -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/rkt/pkg/acl/LICENSE.MIT b/vendor/github.com/coreos/rkt/pkg/acl/LICENSE.MIT deleted file mode 100644 index ed21c8b026b..00000000000 --- a/vendor/github.com/coreos/rkt/pkg/acl/LICENSE.MIT +++ /dev/null @@ -1,22 +0,0 @@ -This project includes code derived from the MIT licensed naegelejd/go-acl -project. Here's a copy of its license: - - Copyright (c) 2015 Joseph Naegele - - 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/rkt/store/LICENSE.BSD b/vendor/github.com/coreos/rkt/store/LICENSE.BSD deleted file mode 100644 index 6b4b6efb9e5..00000000000 --- a/vendor/github.com/coreos/rkt/store/LICENSE.BSD +++ /dev/null @@ -1,30 +0,0 @@ -This project includes code derived from the BSD licensed golang/go project. -Here's a copy of its license: - - 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/dgrijalva/jwt-go/cmd/jwt/app.go b/vendor/github.com/dgrijalva/jwt-go/cmd/jwt/app.go deleted file mode 100644 index 62cb9a46e6a..00000000000 --- a/vendor/github.com/dgrijalva/jwt-go/cmd/jwt/app.go +++ /dev/null @@ -1,186 +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" - - "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) { - return loadData(*flagKey) - }) - - // 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 - keyData, 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 out, err := token.SignedString(keyData); err == nil { - fmt.Println(out) - } else { - return fmt.Errorf("Error signing token: %v", err) - } - - return nil -} diff --git a/vendor/github.com/dgrijalva/jwt-go/test/hmacTestKey b/vendor/github.com/dgrijalva/jwt-go/test/hmacTestKey deleted file mode 100644 index 435b8ddb375..00000000000 --- a/vendor/github.com/dgrijalva/jwt-go/test/hmacTestKey +++ /dev/null @@ -1 +0,0 @@ -#5K+~ew{Z(T(P.ZGwb="=.!r.O͚gЀ \ No newline at end of file diff --git a/vendor/github.com/dgrijalva/jwt-go/test/sample_key b/vendor/github.com/dgrijalva/jwt-go/test/sample_key deleted file mode 100644 index abdbade3129..00000000000 --- a/vendor/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/dgrijalva/jwt-go/test/sample_key.pub b/vendor/github.com/dgrijalva/jwt-go/test/sample_key.pub deleted file mode 100644 index 03dc982acbe..00000000000 --- a/vendor/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/docker/docker/contrib/syntax/vim/LICENSE b/vendor/github.com/docker/docker/contrib/syntax/vim/LICENSE deleted file mode 100644 index e67cdabd22e..00000000000 --- a/vendor/github.com/docker/docker/contrib/syntax/vim/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Honza Pokorny -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/docker/docker/docs/project/images/red_notice.png b/vendor/github.com/docker/docker/docs/project/images/red_notice.png deleted file mode 100644 index 8839723a376..00000000000 Binary files a/vendor/github.com/docker/docker/docs/project/images/red_notice.png and /dev/null differ diff --git a/vendor/github.com/docker/docker/pkg/mflag/LICENSE b/vendor/github.com/docker/docker/pkg/mflag/LICENSE deleted file mode 100644 index ac74d8f0496..00000000000 --- a/vendor/github.com/docker/docker/pkg/mflag/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014-2015 The Docker & 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/docker/engine-api/types/events/events.go b/vendor/github.com/docker/engine-api/types/events/events.go deleted file mode 100644 index c5987aaf14c..00000000000 --- a/vendor/github.com/docker/engine-api/types/events/events.go +++ /dev/null @@ -1,38 +0,0 @@ -package events - -const ( - // ContainerEventType is the event type that containers generate - ContainerEventType = "container" - // ImageEventType is the event type that images generate - ImageEventType = "image" - // VolumeEventType is the event type that volumes generate - VolumeEventType = "volume" - // NetworkEventType is the event type that networks generate - NetworkEventType = "network" -) - -// Actor describes something that generates events, -// like a container, or a network, or a volume. -// It has a defined name and a set or attributes. -// The container attributes are its labels, other actors -// can generate these attributes from other properties. -type Actor struct { - ID string - Attributes map[string]string -} - -// Message represents the information an event contains -type Message struct { - // Deprecated information from JSONMessage. - // With data only in container events. - Status string `json:"status,omitempty"` - ID string `json:"id,omitempty"` - From string `json:"from,omitempty"` - - Type string - Action string - Actor Actor - - Time int64 `json:"time,omitempty"` - TimeNano int64 `json:"timeNano,omitempty"` -} diff --git a/vendor/github.com/docker/engine-api/types/versions/v1p19/types.go b/vendor/github.com/docker/engine-api/types/versions/v1p19/types.go deleted file mode 100644 index 4ed43358811..00000000000 --- a/vendor/github.com/docker/engine-api/types/versions/v1p19/types.go +++ /dev/null @@ -1,35 +0,0 @@ -// Package v1p19 provides specific API types for the API version 1, patch 19. -package v1p19 - -import ( - "github.com/docker/engine-api/types" - "github.com/docker/engine-api/types/container" - "github.com/docker/engine-api/types/versions/v1p20" - "github.com/docker/go-connections/nat" -) - -// ContainerJSON is a backcompatibility struct for APIs prior to 1.20. -// Note this is not used by the Windows daemon. -type ContainerJSON struct { - *types.ContainerJSONBase - Volumes map[string]string - VolumesRW map[string]bool - Config *ContainerConfig - NetworkSettings *v1p20.NetworkSettings -} - -// ContainerConfig is a backcompatibility struct for APIs prior to 1.20. -type ContainerConfig struct { - *container.Config - - MacAddress string - NetworkDisabled bool - ExposedPorts map[nat.Port]struct{} - - // backward compatibility, they now live in HostConfig - VolumeDriver string - Memory int64 - MemorySwap int64 - CPUShares int64 `json:"CpuShares"` - CPUSet string `json:"Cpuset"` -} diff --git a/vendor/github.com/docker/engine-api/types/versions/v1p20/types.go b/vendor/github.com/docker/engine-api/types/versions/v1p20/types.go deleted file mode 100644 index 5736efad003..00000000000 --- a/vendor/github.com/docker/engine-api/types/versions/v1p20/types.go +++ /dev/null @@ -1,40 +0,0 @@ -// Package v1p20 provides specific API types for the API version 1, patch 20. -package v1p20 - -import ( - "github.com/docker/engine-api/types" - "github.com/docker/engine-api/types/container" - "github.com/docker/go-connections/nat" -) - -// ContainerJSON is a backcompatibility struct for the API 1.20 -type ContainerJSON struct { - *types.ContainerJSONBase - Mounts []types.MountPoint - Config *ContainerConfig - NetworkSettings *NetworkSettings -} - -// ContainerConfig is a backcompatibility struct used in ContainerJSON for the API 1.20 -type ContainerConfig struct { - *container.Config - - MacAddress string - NetworkDisabled bool - ExposedPorts map[nat.Port]struct{} - - // backward compatibility, they now live in HostConfig - VolumeDriver string -} - -// StatsJSON is a backcompatibility struct used in Stats for APIs prior to 1.21 -type StatsJSON struct { - types.Stats - Network types.NetworkStats `json:"network,omitempty"` -} - -// NetworkSettings is a backward compatible struct for APIs prior to 1.21 -type NetworkSettings struct { - types.NetworkSettingsBase - types.DefaultNetworkSettings -} diff --git a/vendor/github.com/docker/spdystream/ws/connection.go b/vendor/github.com/docker/spdystream/ws/connection.go deleted file mode 100644 index d0ea001b454..00000000000 --- a/vendor/github.com/docker/spdystream/ws/connection.go +++ /dev/null @@ -1,65 +0,0 @@ -package ws - -import ( - "github.com/gorilla/websocket" - "io" - "log" - "time" -) - -// Wrap an HTTP2 connection over WebSockets and -// use the underlying WebSocket framing for proxy -// compatibility. -type Conn struct { - *websocket.Conn - reader io.Reader -} - -func NewConnection(w *websocket.Conn) *Conn { - return &Conn{Conn: w} -} - -func (c Conn) Write(b []byte) (int, error) { - err := c.WriteMessage(websocket.BinaryMessage, b) - if err != nil { - return 0, err - } - return len(b), nil -} - -func (c Conn) Read(b []byte) (int, error) { - if c.reader == nil { - t, r, err := c.NextReader() - if err != nil { - return 0, err - } - if t != websocket.BinaryMessage { - log.Printf("ws: ignored non-binary message in stream") - return 0, nil - } - c.reader = r - } - n, err := c.reader.Read(b) - if err != nil { - if err == io.EOF { - c.reader = nil - } - return n, err - } - return n, nil -} - -func (c Conn) SetDeadline(t time.Time) error { - if err := c.Conn.SetReadDeadline(t); err != nil { - return err - } - if err := c.Conn.SetWriteDeadline(t); err != nil { - return err - } - return nil -} - -func (c Conn) Close() error { - err := c.Conn.Close() - return err -} diff --git a/vendor/github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs/main.go b/vendor/github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs/main.go deleted file mode 100644 index a5b2b5eef56..00000000000 --- a/vendor/github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs/main.go +++ /dev/null @@ -1,97 +0,0 @@ -package main - -import ( - "bufio" - "bytes" - "flag" - "fmt" - "os" - "os/exec" - "strings" -) - -const bindatafile = "bindata.go" - -func isDebug(args []string) bool { - flagset := flag.NewFlagSet("", flag.ContinueOnError) - debug := flagset.Bool("debug", false, "") - debugArgs := make([]string, 0) - for _, arg := range args { - if strings.HasPrefix(arg, "-debug") { - debugArgs = append(debugArgs, arg) - } - } - flagset.Parse(debugArgs) - if debug == nil { - return false - } - return *debug -} - -func main() { - if _, err := exec.LookPath("go-bindata"); err != nil { - fmt.Println("Cannot find go-bindata executable in path") - fmt.Println("Maybe you need: go get github.com/elazarl/go-bindata-assetfs/...") - os.Exit(1) - } - cmd := exec.Command("go-bindata", os.Args[1:]...) - cmd.Stdin = os.Stdin - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - if err := cmd.Run(); err != nil { - os.Exit(1) - } - in, err := os.Open(bindatafile) - if err != nil { - fmt.Fprintln(os.Stderr, "Cannot read", bindatafile, err) - return - } - out, err := os.Create("bindata_assetfs.go") - if err != nil { - fmt.Fprintln(os.Stderr, "Cannot write 'bindata_assetfs.go'", err) - return - } - debug := isDebug(os.Args[1:]) - r := bufio.NewReader(in) - done := false - for line, isPrefix, err := r.ReadLine(); err == nil; line, isPrefix, err = r.ReadLine() { - if !isPrefix { - line = append(line, '\n') - } - if _, err := out.Write(line); err != nil { - fmt.Fprintln(os.Stderr, "Cannot write to 'bindata_assetfs.go'", err) - return - } - if !done && !isPrefix && bytes.HasPrefix(line, []byte("import (")) { - if debug { - fmt.Fprintln(out, "\t\"net/http\"") - } else { - fmt.Fprintln(out, "\t\"github.com/elazarl/go-bindata-assetfs\"") - } - done = true - } - } - if debug { - fmt.Fprintln(out, ` -func assetFS() http.FileSystem { - for k := range _bintree.Children { - return http.Dir(k) - } - panic("unreachable") -}`) - } else { - fmt.Fprintln(out, ` -func assetFS() *assetfs.AssetFS { - for k := range _bintree.Children { - return &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: k} - } - panic("unreachable") -}`) - } - // Close files BEFORE remove calls (don't use defer). - in.Close() - out.Close() - if err := os.Remove(bindatafile); err != nil { - fmt.Fprintln(os.Stderr, "Cannot remove", bindatafile, err) - } -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/README.md b/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/README.md deleted file mode 100644 index 8778f2a75b2..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Simple HTTP Proxy - -`goproxy-basic` starts an HTTP proxy on :8080. It only handles explicit CONNECT -requests. - -Start it in one shell: - -```sh -goproxy-basic -v -``` - -Fetch goproxy homepage in another: - -```sh -http_proxy=http://127.0.0.1:8080 wget -O - \ - http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -``` - -The homepage HTML content should be displayed in the console. The proxy should -have logged the request being processed: - -```sh -2015/04/09 18:19:17 [001] INFO: Got request /p/introducing-goproxy-light-http-proxy/ ripper234.com GET http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -2015/04/09 18:19:17 [001] INFO: Sending request GET http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -2015/04/09 18:19:18 [001] INFO: Received response 200 OK -2015/04/09 18:19:18 [001] INFO: Copying response to client 200 OK [200] -2015/04/09 18:19:18 [001] INFO: Copied 44333 bytes to client error= -``` - diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/main.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/main.go deleted file mode 100644 index 22dc4a9073b..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/main.go +++ /dev/null @@ -1,17 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "log" - "flag" - "net/http" -) - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - flag.Parse() - proxy := goproxy.NewProxyHttpServer() - proxy.Verbose = *verbose - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-eavesdropper/main.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-eavesdropper/main.go deleted file mode 100644 index 9d80653be5e..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-eavesdropper/main.go +++ /dev/null @@ -1,56 +0,0 @@ -package main - -import ( - "bufio" - "flag" - "log" - "net" - "net/http" - "regexp" - - "github.com/elazarl/goproxy" -) - -func orPanic(err error) { - if err != nil { - panic(err) - } -} - -func main() { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*baidu.com$"))). - HandleConnect(goproxy.AlwaysReject) - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*$"))). - HandleConnect(goproxy.AlwaysMitm) - // enable curl -p for all hosts on port 80 - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*:80$"))). - HijackConnect(func(req *http.Request, client net.Conn, ctx *goproxy.ProxyCtx) { - defer func() { - if e := recover(); e != nil { - ctx.Logf("error connecting to remote: %v", e) - client.Write([]byte("HTTP/1.1 500 Cannot reach destination\r\n\r\n")) - } - client.Close() - }() - clientBuf := bufio.NewReadWriter(bufio.NewReader(client), bufio.NewWriter(client)) - remote, err := net.Dial("tcp", req.URL.Host) - orPanic(err) - remoteBuf := bufio.NewReadWriter(bufio.NewReader(remote), bufio.NewWriter(remote)) - for { - req, err := http.ReadRequest(clientBuf.Reader) - orPanic(err) - orPanic(req.Write(remoteBuf)) - orPanic(remoteBuf.Flush()) - resp, err := http.ReadResponse(remoteBuf.Reader, req) - orPanic(err) - orPanic(resp.Write(clientBuf.Writer)) - orPanic(clientBuf.Flush()) - } - }) - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - flag.Parse() - proxy.Verbose = *verbose - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/README.md b/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/README.md deleted file mode 100644 index 7240d8eacfe..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Trace HTTP Requests and Responses - -`goproxy-httpdump` starts an HTTP proxy on :8080. It handles explicit CONNECT -requests and traces them in a "db" directory created in the proxy working -directory. Each request type and headers are logged in a "log" file, while -their bodies are dumped in files prefixed with the request session identifier. - -Additionally, the example demonstrates how to: -- Log information asynchronously (see HttpLogger) -- Allow the proxy to be stopped manually while ensuring all pending requests - have been processed (in this case, logged). - -Start it in one shell: - -```sh -goproxy-httpdump -``` - -Fetch goproxy homepage in another: - -```sh -http_proxy=http://127.0.0.1:8080 wget -O - \ - http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -``` - -A "db" directory should have appeared where you started the proxy, containing -two files: -- log: the request/response traces -- 1\_resp: the first response body - diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/httpdump.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/httpdump.go deleted file mode 100644 index 62a9b882373..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/httpdump.go +++ /dev/null @@ -1,285 +0,0 @@ -package main - -import ( - "errors" - "flag" - "fmt" - "io" - "log" - "net" - "net/http" - "net/http/httputil" - "os" - "os/signal" - "path" - "sync" - "time" - - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/transport" -) - -type FileStream struct { - path string - f *os.File -} - -func NewFileStream(path string) *FileStream { - return &FileStream{path, nil} -} - -func (fs *FileStream) Write(b []byte) (nr int, err error) { - if fs.f == nil { - fs.f, err = os.Create(fs.path) - if err != nil { - return 0, err - } - } - return fs.f.Write(b) -} - -func (fs *FileStream) Close() error { - fmt.Println("Close", fs.path) - if fs.f == nil { - return errors.New("FileStream was never written into") - } - return fs.f.Close() -} - -type Meta struct { - req *http.Request - resp *http.Response - err error - t time.Time - sess int64 - bodyPath string - from string -} - -func fprintf(nr *int64, err *error, w io.Writer, pat string, a ...interface{}) { - if *err != nil { - return - } - var n int - n, *err = fmt.Fprintf(w, pat, a...) - *nr += int64(n) -} - -func write(nr *int64, err *error, w io.Writer, b []byte) { - if *err != nil { - return - } - var n int - n, *err = w.Write(b) - *nr += int64(n) -} - -func (m *Meta) WriteTo(w io.Writer) (nr int64, err error) { - if m.req != nil { - fprintf(&nr, &err, w, "Type: request\r\n") - } else if m.resp != nil { - fprintf(&nr, &err, w, "Type: response\r\n") - } - fprintf(&nr, &err, w, "ReceivedAt: %v\r\n", m.t) - fprintf(&nr, &err, w, "Session: %d\r\n", m.sess) - fprintf(&nr, &err, w, "From: %v\r\n", m.from) - if m.err != nil { - // note the empty response - fprintf(&nr, &err, w, "Error: %v\r\n\r\n\r\n\r\n", m.err) - } else if m.req != nil { - fprintf(&nr, &err, w, "\r\n") - buf, err2 := httputil.DumpRequest(m.req, false) - if err2 != nil { - return nr, err2 - } - write(&nr, &err, w, buf) - } else if m.resp != nil { - fprintf(&nr, &err, w, "\r\n") - buf, err2 := httputil.DumpResponse(m.resp, false) - if err2 != nil { - return nr, err2 - } - write(&nr, &err, w, buf) - } - return -} - -// HttpLogger is an asynchronous HTTP request/response logger. It traces -// requests and responses headers in a "log" file in logger directory and dumps -// their bodies in files prefixed with the session identifiers. -// Close it to ensure pending items are correctly logged. -type HttpLogger struct { - path string - c chan *Meta - errch chan error -} - -func NewLogger(basepath string) (*HttpLogger, error) { - f, err := os.Create(path.Join(basepath, "log")) - if err != nil { - return nil, err - } - logger := &HttpLogger{basepath, make(chan *Meta), make(chan error)} - go func() { - for m := range logger.c { - if _, err := m.WriteTo(f); err != nil { - log.Println("Can't write meta", err) - } - } - logger.errch <- f.Close() - }() - return logger, nil -} - -func (logger *HttpLogger) LogResp(resp *http.Response, ctx *goproxy.ProxyCtx) { - body := path.Join(logger.path, fmt.Sprintf("%d_resp", ctx.Session)) - from := "" - if ctx.UserData != nil { - from = ctx.UserData.(*transport.RoundTripDetails).TCPAddr.String() - } - if resp == nil { - resp = emptyResp - } else { - resp.Body = NewTeeReadCloser(resp.Body, NewFileStream(body)) - } - logger.LogMeta(&Meta{ - resp: resp, - err: ctx.Error, - t: time.Now(), - sess: ctx.Session, - from: from}) -} - -var emptyResp = &http.Response{} -var emptyReq = &http.Request{} - -func (logger *HttpLogger) LogReq(req *http.Request, ctx *goproxy.ProxyCtx) { - body := path.Join(logger.path, fmt.Sprintf("%d_req", ctx.Session)) - if req == nil { - req = emptyReq - } else { - req.Body = NewTeeReadCloser(req.Body, NewFileStream(body)) - } - logger.LogMeta(&Meta{ - req: req, - err: ctx.Error, - t: time.Now(), - sess: ctx.Session, - from: req.RemoteAddr}) -} - -func (logger *HttpLogger) LogMeta(m *Meta) { - logger.c <- m -} - -func (logger *HttpLogger) Close() error { - close(logger.c) - return <-logger.errch -} - -// TeeReadCloser extends io.TeeReader by allowing reader and writer to be -// closed. -type TeeReadCloser struct { - r io.Reader - w io.WriteCloser - c io.Closer -} - -func NewTeeReadCloser(r io.ReadCloser, w io.WriteCloser) io.ReadCloser { - return &TeeReadCloser{io.TeeReader(r, w), w, r} -} - -func (t *TeeReadCloser) Read(b []byte) (int, error) { - return t.r.Read(b) -} - -// Close attempts to close the reader and write. It returns an error if both -// failed to Close. -func (t *TeeReadCloser) Close() error { - err1 := t.c.Close() - err2 := t.w.Close() - if err1 != nil { - return err1 - } - return err2 -} - -// stoppableListener serves stoppableConn and tracks their lifetime to notify -// when it is safe to terminate the application. -type stoppableListener struct { - net.Listener - sync.WaitGroup -} - -type stoppableConn struct { - net.Conn - wg *sync.WaitGroup -} - -func newStoppableListener(l net.Listener) *stoppableListener { - return &stoppableListener{l, sync.WaitGroup{}} -} - -func (sl *stoppableListener) Accept() (net.Conn, error) { - c, err := sl.Listener.Accept() - if err != nil { - return c, err - } - sl.Add(1) - return &stoppableConn{c, &sl.WaitGroup}, nil -} - -func (sc *stoppableConn) Close() error { - sc.wg.Done() - return sc.Conn.Close() -} - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("l", ":8080", "on which address should the proxy listen") - flag.Parse() - proxy := goproxy.NewProxyHttpServer() - proxy.Verbose = *verbose - if err := os.MkdirAll("db", 0755); err != nil { - log.Fatal("Can't create dir", err) - } - logger, err := NewLogger("db") - if err != nil { - log.Fatal("can't open log file", err) - } - tr := transport.Transport{Proxy: transport.ProxyFromEnvironment} - // For every incoming request, override the RoundTripper to extract - // connection information. Store it is session context log it after - // handling the response. - proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - ctx.RoundTripper = goproxy.RoundTripperFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (resp *http.Response, err error) { - ctx.UserData, resp, err = tr.DetailedRoundTrip(req) - return - }) - logger.LogReq(req, ctx) - return req, nil - }) - proxy.OnResponse().DoFunc(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - logger.LogResp(resp, ctx) - return resp - }) - l, err := net.Listen("tcp", *addr) - if err != nil { - log.Fatal("listen:", err) - } - sl := newStoppableListener(l) - ch := make(chan os.Signal) - signal.Notify(ch, os.Interrupt) - go func() { - <-ch - log.Println("Got SIGINT exiting") - sl.Add(1) - sl.Close() - logger.Close() - sl.Done() - }() - log.Println("Starting Proxy") - http.Serve(sl, proxy) - sl.Wait() - log.Println("All connections closed - exit") -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/README.md b/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/README.md deleted file mode 100644 index 6efba22adc5..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Content Analysis - -`goproxy-jquery-version` starts an HTTP proxy on :8080. It checks HTML -responses, looks for scripts referencing jQuery library and emits warnings if -different versions of the library are being used for a given host. - -Start it in one shell: - -```sh -goproxy-jquery-version -``` - -Fetch goproxy homepage in another: - -```sh -http_proxy=http://127.0.0.1:8080 wget -O - \ - http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -``` - -Goproxy homepage uses jQuery and a mix of plugins. First the proxy reports the -first use of jQuery it detects for the domain. Then, because the regular -expression matching the jQuery sources is imprecise, it reports a mismatch with -a plugin reference: - -```sh -2015/04/11 11:23:02 [001] WARN: ripper234.com uses //ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js -2015/04/11 11:23:02 [001] WARN: In http://ripper234.com/p/introducing-goproxy-light-http-proxy/, \ - Contradicting jqueries //ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js \ - http://ripper234.wpengine.netdna-cdn.com/wp-content/plugins/wp-ajax-edit-comments/js/jquery.colorbox.min.js?ver=5.0.36 -``` - diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery1.html b/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery1.html deleted file mode 100644 index 26771ce34d0..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery1.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery2.html b/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery2.html deleted file mode 100644 index 7dce036146a..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery2.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_homepage.html b/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_homepage.html deleted file mode 100644 index 27dd0b38a77..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_homepage.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - jQuery: The Write Less, Do More, JavaScript Library - - - - - - - - - -
-
- - -
- -
- - - - - -
- -
- -
-

jQuery is a new kind of JavaScript Library.

-

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

- -
- -
-

Grab the latest version!

-
-
- Choose your compression level: -
- - jquery-1.7.2.min.js - - - jquery-1.7.2.js - -
- -

Current Release: v1.7.2

-
-
- -
- - - - -
- -
-

Learn jQuery Now!

-

What does jQuery code look like? Here's the quick and dirty:

-
-
$("p.neat").addClass("ohmy").show("slow");
- Run Code - -

Congratulations! You just ran a snippet of jQuery code. Wasn't that easy? There's lots of example code throughout the documentation on this site. Be sure to give all the code a test run to see what happens.

-
-
- - - -
-

jQuery Resources

- - - -
- -
- -
-

Books About jQuery

- - - -
- - - -
- - - -
- - - - diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/main.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/main.go deleted file mode 100644 index a92dddeacb2..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/main.go +++ /dev/null @@ -1,64 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/ext/html" - "log" - "net/http" - "regexp" -) - -var ( - // who said we can't parse HTML with regexp? - scriptMatcher = regexp.MustCompile(`(?i:]*\ssrc=["']([^"']*)["'])`) -) - -// findScripts returns all sources of HTML script tags found in input text. -func findScriptSrc(html string) []string { - srcs := make([]string, 0) - matches := scriptMatcher.FindAllStringIndex(html, -1) - for _, match := range matches { - // -1 to capture the whitespace at the end of the script tag - srcMatch := srcAttrMatcher.FindStringSubmatch(html[match[1]-1:]) - if srcMatch != nil { - srcs = append(srcs, srcMatch[1]) - } - } - return srcs -} - -// NewJQueryVersionProxy creates a proxy checking responses HTML content, looks -// for scripts referencing jQuery library and emits warnings if different -// versions of the library are being used for a given host. -func NewJqueryVersionProxy() *goproxy.ProxyHttpServer { - proxy := goproxy.NewProxyHttpServer() - m := make(map[string]string) - jqueryMatcher := regexp.MustCompile(`(?i:jquery\.)`) - proxy.OnResponse(goproxy_html.IsHtml).Do(goproxy_html.HandleString( - func(s string, ctx *goproxy.ProxyCtx) string { - for _, src := range findScriptSrc(s) { - if !jqueryMatcher.MatchString(src) { - continue - } - prev, ok := m[ctx.Req.Host] - if ok { - if prev != src { - ctx.Warnf("In %v, Contradicting jqueries %v %v", - ctx.Req.URL, prev, src) - break - } - } else { - ctx.Warnf("%s uses jquery %s", ctx.Req.Host, src) - m[ctx.Req.Host] = src - } - } - return s - })) - return proxy -} - -func main() { - proxy := NewJqueryVersionProxy() - log.Fatal(http.ListenAndServe(":8080", proxy)) -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/php_man.html b/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/php_man.html deleted file mode 100644 index 1159d762d6a..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/php_man.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - PHP: PHP Manual - Manual - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

- - search for - - - in the - - - -

-
-
- -
-
- - - -
-
- -
- - - -   - -
- [edit] Last updated: Fri, 23 Mar 2012 -
-
-

view this page in

- -
-
-
- - -
-

PHP Manual

- - - -
-
- -
by:
- - Mehdi Achour - -
- - -
- - Friedhelm Betz - -
- - -
- - Antony Dovgal - -
- - -
- - Nuno Lopes - -
- - -
- - Hannes Magnusson - -
- - -
- - Georg Richter - -
- - -
- - Damien Seguy - -
- - -
- - Jakub Vrana - -
- - - -
- - - And several others - - -
- -
-
2012-03-23
- -
-
Edited By: - - Philip Olson - -
- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -


-
-
- add a note add a note - User Contributed Notes - PHP Manual -
-
There are no user contributed notes for this page.

-
-
 
-
- - - - - - - \ No newline at end of file diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/w3schools.html b/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/w3schools.html deleted file mode 100644 index ecf3a9dfec3..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/w3schools.html +++ /dev/null @@ -1,1610 +0,0 @@ - - - - - - - - -HTML5 Tutorial - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- -
- -
- - W3Schools.com - -
- - - -
- - - - - -
- - - - - -
- -
- -
- -
- -
- - HOME - - HTML - - CSS - - XML - - JAVASCRIPT - - ASP - - PHP - - SQL - - MORE... - -
- -
- - REFERENCES | - - EXAMPLES | - - FORUM | - - ABOUT - -
- -
- - - -
- - - - - - - - - - - - - -
- - - - - - - - - -
- -
- -

HTML5 Tutorial

- -HTML5 Home
- -HTML5 Introduction
- -HTML5 New Elements
- -HTML5 Video
- -HTML5 Video/DOM
- -HTML5 Audio
- -HTML5 Drag and Drop
- -HTML5 Canvas
- -HTML5 SVG
- -HTML5 Canvas vs. SVG
- -HTML5 Geolocation
- -HTML5 Web Storage
- -HTML5 App Cache
- -HTML5 Web Workers
- -HTML5 SSE
- -
- -

HTML5 Forms

- -HTML5 Input Types
- -HTML5 Form Elements
- -HTML5 Form Attributes
- -
- -

HTML5 Reference

- -HTML5 Tags
- -HTML5 Attributes
- -HTML5 Events
- -HTML5 Audio/Video
- -HTML5 Canvas 2d
- -HTML Valid DTDs
- -
- -

HTML5 Tags

- -<!-->
- -<!DOCTYPE>
- -<a>
- -<abbr>
- -<acronym>
- -<address>
- -<applet>
- -<area>
- -<article>
- -<aside>
- -<audio>
- -<b>
- -<base>
- -<basefont>
- -<bdi>
- -<bdo>
- -<big>
- -<blockquote>
- -<body>
- -<br>
- -<button>
- -<canvas>
- -<caption>
- -<center>
- -<cite>
- -<code>
- -<col>
- -<colgroup>
- -<command>
- -<datalist>
- -<dd>
- -<del>
- -<details>
- -<dfn>
- -<dir>
- -<div>
- -<dl>
- -<dt>
- -<em>
- -<embed>
- -<fieldset>
- -<figcaption>
- -<figure>
- -<font>
- -<footer>
- -<form>
- -<frame>
- -<frameset>
- -<h1> - <h6>
- -<head>
- -<header>
- -<hgroup>
- -<hr>
- -<html>
- -<i>
- -<iframe>
- -<img>
- -<input>
- -<ins>
- -<keygen>
- -<kbd>
- -<label>
- -<legend>
- -<li>
- -<link>
- -<map>
- -<mark>
- -<menu>
- -<meta>
- -<meter>
- -<nav>
- -<noframes>
- -<noscript>
- -<object>
- -<ol>
- -<optgroup>
- -<option>
- -<output>
- -<p>
- -<param>
- -<pre>
- -<progress>
- -<q>
- -<rp>
- -<rt>
- -<ruby>
- -<s>
- -<samp>
- -<script>
- -<section>
- -<select>
- -<small>
- -<source>
- -<span>
- -<strike>
- -<strong>
- -<style>
- -<sub>
- -<summary>
- -<sup>
- -<table>
- -<tbody>
- -<td>
- -<textarea>
- -<tfoot>
- -<th>
- -<thead>
- -<time>
- -<title>
- -<tr>
- -<track>
- -<tt>
- -<u>
- -<ul>
- -<var>
- -<video>
- -<wbr>
- -
- -
- - - -

HTML5 Tutorial

- - - -
- -
- -
HTML5 is The New HTML Standard
- -
- - - - - -
- - - - - - - - - - - -
- -
- -
- -

HTML5

- -
    - -
  • New Elements
  • - -
  • New Attributes
  • - -
  • Full CSS3 Support
  • - -
  • Video and Audio
  • - -
  • 2D/3D Graphics
  • - -
  • Local Storage
  • - -
  • Local SQL Database
  • - -
  • Web Applications
  • - -
- -
- - - - - - - - - - - - - - - - - - - -
- -
- -
    - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
- -
- -
- -
- -

Examples in Each Chapter

- -

With our HTML editor, you can edit the HTML, and click on a button to view the result.

- -
- -

Example

- -
- - <!DOCTYPE HTML>
- - <html>
- - <body>
- -
- - <video width="320" height="240" controls="controls">
- -  <source src="movie.mp4" type="video/mp4" />
- -  <source src="movie.ogg" type="video/ogg" />
- -  <source src="movie.webm" type="video/webm" />
- - Your browser does not support the video tag.
- - </video>
- -
- - </body>
- - </html> - -
- -
- - Try it yourself »
- -

Click on the "Try it yourself" button to see how it works

- -

Start learning HTML5 now!

- - - -

HTML5 References

- -

At W3Schools you will find complete references about tags, global attributes, - -standard events, and more.

- -

- -HTML5 Tag Reference - -

- - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - -
WEB HOSTING
- -Best Web Hosting - -
- -PHP MySQL Hosting - -
- -Best Hosting Coupons - -
- -UK Reseller Hosting - -
- -Cloud Hosting - -
- -Top Web Hosting - -
- -$3.98 Unlimited Hosting - -
- -Premium Website Design - -
- - - - - - - - - - - - - -
WEB BUILDING
- - - -Download XML Editor - - - -
- -FREE Website BUILDER - -
- -Free Website Templates - -Free CSS Templates - -
- -CREATE HTML Websites - -
- - - - - - - -
W3SCHOOLS EXAMS
- -Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
- -
- - - - - - - -
W3SCHOOLS BOOKS
- - - -New Books:
HTML, CSS
- -JavaScript, and Ajax
- -
- - - - - -
STATISTICS
- -Browser Statistics
- -Browser OS
- -Browser Display - -
- - - - - - - - - - - - - -
SHARE THIS PAGE
- - - -
- - - - - - - -

- -
- - - - - -
- -
- - - -
- -
- -
- -
- -
- - - -
- -
- - - - - - - - - diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/README.md b/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/README.md deleted file mode 100644 index 23b52240533..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Request Filtering - -`goproxy-no-reddit-at-work` starts an HTTP proxy on :8080. It denies requests -to "www.reddit.com" made between 8am to 5pm inclusive, local time. - -Start it in one shell: - -```sh -$ goproxy-no-reddit-at-work -``` - -Fetch reddit in another: - -```sh -$ http_proxy=http://127.0.0.1:8080 wget -O - http://www.reddit.com ---2015-04-11 16:59:01-- http://www.reddit.com/ -Connecting to 127.0.0.1:8080... connected. -Proxy request sent, awaiting response... 403 Forbidden -2015-04-11 16:59:01 ERROR 403: Forbidden. -``` - diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/noreddit.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/noreddit.go deleted file mode 100644 index b174845929c..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/noreddit.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "log" - "net/http" - "time" -) - -func main() { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest(goproxy.DstHostIs("www.reddit.com")).DoFunc( - func(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - h, _, _ := time.Now().Clock() - if h >= 8 && h <= 17 { - return r, goproxy.NewResponse(r, - goproxy.ContentTypeText, http.StatusForbidden, - "Don't waste your time!") - } else { - ctx.Warnf("clock: %d, you can waste your time...", h) - } - return r, nil - }) - log.Fatalln(http.ListenAndServe(":8080", proxy)) -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-sokeepalive/sokeepalive.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-sokeepalive/sokeepalive.go deleted file mode 100644 index 86d8bcfcb5c..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-sokeepalive/sokeepalive.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "log" - "flag" - "net" - "net/http" -) - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - flag.Parse() - proxy := goproxy.NewProxyHttpServer() - proxy.Tr.Dial = func(network, addr string) (c net.Conn, err error) { - c, err = net.Dial(network, addr) - if c, ok := c.(*net.TCPConn); err != nil && ok { - c.SetKeepAlive(true) - } - return - } - proxy.Verbose = *verbose - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-sslstrip/sslstrip.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-sslstrip/sslstrip.go deleted file mode 100644 index b7e2dc9e5ec..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-sslstrip/sslstrip.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "log" - "flag" - "net/http" -) - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - flag.Parse() - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm) - proxy.OnRequest().DoFunc(func (req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - if req.URL.Scheme == "https" { - req.URL.Scheme = "http" - } - return req, nil - }) - proxy.Verbose = *verbose - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/README.md b/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/README.md deleted file mode 100644 index a51d4c8ebcf..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Gather Browsing Statistics - -`goproxy-stats` starts an HTTP proxy on :8080, counts the bytes received for -web resources and prints the cumulative sum per URL every 20 seconds. - -Start it in one shell: - -```sh -goproxy-stats -``` - -Fetch goproxy homepage in another: - -```sh -mkdir tmp -cd tmp -http_proxy=http://127.0.0.1:8080 wget -r -l 1 -H \ - http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -``` - -Stop it after a moment. `goproxy-stats` should eventually print: -```sh -listening on :8080 -statistics -http://www.telerik.com/fiddler -> 84335 -http://msmvps.com/robots.txt -> 157 -http://eli.thegreenplace.net/robots.txt -> 294 -http://www.phdcomics.com/robots.txt -> 211 -http://resharper.blogspot.com/robots.txt -> 221 -http://idanz.blogli.co.il/robots.txt -> 271 -http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -> 44407 -http://live.gnome.org/robots.txt -> 298 -http://ponetium.wordpress.com/robots.txt -> 178 -http://pilaheleg.blogli.co.il/robots.txt -> 321 -http://pilaheleg.wordpress.com/robots.txt -> 178 -http://blogli.co.il/ -> 9165 -http://nimrod-code.org/robots.txt -> 289 -http://www.joelonsoftware.com/robots.txt -> 1245 -http://top-performance.blogspot.com/robots.txt -> 227 -http://ooc-lang.org/robots.txt -> 345 -http://blogs.jetbrains.com/robots.txt -> 293 -``` - diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/main.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/main.go deleted file mode 100644 index e4cde8d9399..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/main.go +++ /dev/null @@ -1,66 +0,0 @@ -package main - -import ( - "fmt" - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/ext/html" - "io" - "log" - . "net/http" - "time" -) - -type Count struct { - Id string - Count int64 -} -type CountReadCloser struct { - Id string - R io.ReadCloser - ch chan<- Count - nr int64 -} - -func (c *CountReadCloser) Read(b []byte) (n int, err error) { - n, err = c.R.Read(b) - c.nr += int64(n) - return -} -func (c CountReadCloser) Close() error { - c.ch <- Count{c.Id, c.nr} - return c.R.Close() -} - -func main() { - proxy := goproxy.NewProxyHttpServer() - timer := make(chan bool) - ch := make(chan Count, 10) - go func() { - for { - time.Sleep(20 * time.Second) - timer <- true - } - }() - go func() { - m := make(map[string]int64) - for { - select { - case c := <-ch: - m[c.Id] = m[c.Id] + c.Count - case <-timer: - fmt.Printf("statistics\n") - for k, v := range m { - fmt.Printf("%s -> %d\n", k, v) - } - } - } - }() - - // IsWebRelatedText filters on html/javascript/css resources - proxy.OnResponse(goproxy_html.IsWebRelatedText).DoFunc(func(resp *Response, ctx *goproxy.ProxyCtx) *Response { - resp.Body = &CountReadCloser{ctx.Req.URL.String(), resp.Body, ch, 0} - return resp - }) - fmt.Printf("listening on :8080\n") - log.Fatal(ListenAndServe(":8080", proxy)) -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/README.md b/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/README.md deleted file mode 100644 index 7edb0989bf3..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Transparent Proxy - -This transparent example in goproxy is meant to show how to transparenty proxy and hijack all http and https connections while doing a man-in-the-middle to the TLS session. It requires that goproxy sees all the packets traversing out to the internet. Linux iptables rules deal with changing the source/destination IPs to act transparently, but you do need to setup your network configuration so that goproxy is a mandatory stop on the outgoing route. Primarily you can do this by placing the proxy inline. goproxy does not have any WCCP support itself; patches welcome. - -## Why not explicit? - -Transparent proxies are more difficult to maintain and setup from a server side, but they require no configuration on the client(s) which could be in unmanaged systems or systems that don't support a proxy configuration. See the [eavesdropper example](https://github.com/elazarl/goproxy/blob/master/examples/goproxy-eavesdropper/main.go) if you want to see an explicit proxy example. - -## Potential Issues - -Support for very old clients using HTTPS will fail. Clients need to send the SNI value in the TLS ClientHello which most modern clients do these days, but old clients will break. - -If you're routing table allows for it, an explicit http request to goproxy will cause it to fail in an endless loop since it will try to request resources from itself repeatedly. This could be solved in the goproxy code by looking up the hostnames, but it adds a delay that is much easier/faster to handle on the routing side. - -## Routing Rules - -Example routing rules are included in [proxy.sh](https://github.com/elazarl/goproxy/blob/master/examples/goproxy-transparent/proxy.sh) but are best when setup using your distribution's configuration. diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/proxy.sh b/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/proxy.sh deleted file mode 100644 index c63111432e2..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/proxy.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# goproxy IP -GOPROXY_SERVER="10.10.10.1" -# goproxy port -GOPROXY_PORT="3129" -GOPROXY_PORT_TLS="3128" -# DO NOT MODIFY BELOW -# Load IPTABLES modules for NAT and IP conntrack support -modprobe ip_conntrack -modprobe ip_conntrack_ftp -echo 1 > /proc/sys/net/ipv4/ip_forward -echo 2 > /proc/sys/net/ipv4/conf/all/rp_filter - -# Clean old firewall -iptables -t nat -F -iptables -t nat -X -iptables -t mangle -F -iptables -t mangle -X - -# Write new rules -iptables -t nat -A PREROUTING -s $GOPROXY_SERVER -p tcp --dport $GOPROXY_PORT -j ACCEPT -iptables -t nat -A PREROUTING -s $GOPROXY_SERVER -p tcp --dport $GOPROXY_PORT_TLS -j ACCEPT -iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination $GOPROXY_SERVER:$GOPROXY_PORT -iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination $GOPROXY_SERVER:$GOPROXY_PORT_TLS -# The following line supports using goproxy as an explicit proxy in addition -iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination $GOPROXY_SERVER:$GOPROXY_PORT -iptables -t nat -A POSTROUTING -j MASQUERADE -iptables -t mangle -A PREROUTING -p tcp --dport $GOPROXY_PORT -j DROP -iptables -t mangle -A PREROUTING -p tcp --dport $GOPROXY_PORT_TLS -j DROP diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/transparent.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/transparent.go deleted file mode 100644 index b4134e23b72..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/transparent.go +++ /dev/null @@ -1,148 +0,0 @@ -package main - -import ( - "bufio" - "bytes" - "flag" - "fmt" - "log" - "net" - "net/http" - "net/url" - "regexp" - - "github.com/elazarl/goproxy" - "github.com/inconshreveable/go-vhost" -) - -func orPanic(err error) { - if err != nil { - panic(err) - } -} - -func main() { - verbose := flag.Bool("v", true, "should every proxy request be logged to stdout") - http_addr := flag.String("httpaddr", ":3129", "proxy http listen address") - https_addr := flag.String("httpsaddr", ":3128", "proxy https listen address") - flag.Parse() - - proxy := goproxy.NewProxyHttpServer() - proxy.Verbose = *verbose - if proxy.Verbose { - log.Printf("Server starting up! - configured to listen on http interface %s and https interface %s", *http_addr, *https_addr) - } - - proxy.NonproxyHandler = http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - if req.Host == "" { - fmt.Fprintln(w, "Cannot handle requests without Host header, e.g., HTTP 1.0") - return - } - req.URL.Scheme = "http" - req.URL.Host = req.Host - proxy.ServeHTTP(w, req) - }) - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*$"))). - HandleConnect(goproxy.AlwaysMitm) - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*:80$"))). - HijackConnect(func(req *http.Request, client net.Conn, ctx *goproxy.ProxyCtx) { - defer func() { - if e := recover(); e != nil { - ctx.Logf("error connecting to remote: %v", e) - client.Write([]byte("HTTP/1.1 500 Cannot reach destination\r\n\r\n")) - } - client.Close() - }() - clientBuf := bufio.NewReadWriter(bufio.NewReader(client), bufio.NewWriter(client)) - remote, err := connectDial(proxy, "tcp", req.URL.Host) - orPanic(err) - remoteBuf := bufio.NewReadWriter(bufio.NewReader(remote), bufio.NewWriter(remote)) - for { - req, err := http.ReadRequest(clientBuf.Reader) - orPanic(err) - orPanic(req.Write(remoteBuf)) - orPanic(remoteBuf.Flush()) - resp, err := http.ReadResponse(remoteBuf.Reader, req) - orPanic(err) - orPanic(resp.Write(clientBuf.Writer)) - orPanic(clientBuf.Flush()) - } - }) - - go func() { - log.Fatalln(http.ListenAndServe(*http_addr, proxy)) - }() - - // listen to the TLS ClientHello but make it a CONNECT request instead - ln, err := net.Listen("tcp", *https_addr) - if err != nil { - log.Fatalf("Error listening for https connections - %v", err) - } - for { - c, err := ln.Accept() - if err != nil { - log.Printf("Error accepting new connection - %v", err) - continue - } - go func(c net.Conn) { - tlsConn, err := vhost.TLS(c) - if err != nil { - log.Printf("Error accepting new connection - %v", err) - } - if tlsConn.Host() == "" { - log.Printf("Cannot support non-SNI enabled clients") - return - } - connectReq := &http.Request{ - Method: "CONNECT", - URL: &url.URL{ - Opaque: tlsConn.Host(), - Host: net.JoinHostPort(tlsConn.Host(), "443"), - }, - Host: tlsConn.Host(), - Header: make(http.Header), - } - resp := dumbResponseWriter{tlsConn} - proxy.ServeHTTP(resp, connectReq) - }(c) - } -} - -// copied/converted from https.go -func dial(proxy *goproxy.ProxyHttpServer, network, addr string) (c net.Conn, err error) { - if proxy.Tr.Dial != nil { - return proxy.Tr.Dial(network, addr) - } - return net.Dial(network, addr) -} - -// copied/converted from https.go -func connectDial(proxy *goproxy.ProxyHttpServer, network, addr string) (c net.Conn, err error) { - if proxy.ConnectDial == nil { - return dial(proxy, network, addr) - } - return proxy.ConnectDial(network, addr) -} - -type dumbResponseWriter struct { - net.Conn -} - -func (dumb dumbResponseWriter) Header() http.Header { - panic("Header() should not be called on this ResponseWriter") -} - -func (dumb dumbResponseWriter) Write(buf []byte) (int, error) { - if bytes.Equal(buf, []byte("HTTP/1.0 200 OK\r\n\r\n")) { - return len(buf), nil // throw away the HTTP OK response from the faux CONNECT request - } - return dumb.Conn.Write(buf) -} - -func (dumb dumbResponseWriter) WriteHeader(code int) { - panic("WriteHeader() should not be called on this ResponseWriter") -} - -func (dumb dumbResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { - return dumb, bufio.NewReadWriter(bufio.NewReader(dumb), bufio.NewWriter(dumb)), nil -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-upside-down-ternet/main.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-upside-down-ternet/main.go deleted file mode 100644 index 4b683fd329a..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-upside-down-ternet/main.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/ext/image" - "image" - "log" - "net/http" -) - -func main() { - proxy := goproxy.NewProxyHttpServer() - proxy.OnResponse().Do(goproxy_image.HandleImage(func(img image.Image, ctx *goproxy.ProxyCtx) image.Image { - dx, dy := img.Bounds().Dx(), img.Bounds().Dy() - - nimg := image.NewRGBA(img.Bounds()) - for i := 0; i < dx; i++ { - for j := 0; j <= dy; j++ { - nimg.Set(i, j, img.At(i, dy-j-1)) - } - } - return nimg - })) - proxy.Verbose = true - log.Fatal(http.ListenAndServe(":8080", proxy)) -} diff --git a/vendor/github.com/elazarl/goproxy/examples/goproxy-yui-minify/yui.go b/vendor/github.com/elazarl/goproxy/examples/goproxy-yui-minify/yui.go deleted file mode 100644 index 0e7eadbb157..00000000000 --- a/vendor/github.com/elazarl/goproxy/examples/goproxy-yui-minify/yui.go +++ /dev/null @@ -1,91 +0,0 @@ -// This example would minify standalone Javascript files (identified by their content type) -// using the command line utility YUI compressor http://yui.github.io/yuicompressor/ -// Example usage: -// -// ./yui -java /usr/local/bin/java -yuicompressor ~/Downloads/yuicompressor-2.4.8.jar -// $ curl -vx localhost:8080 http://golang.org/lib/godoc/godocs.js -// (function(){function g(){var u=$("#search");if(u.length===0){return}function t(){if(.... -// $ curl http://golang.org/lib/godoc/godocs.js | head -n 3 -// // 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 main - -import ( - "flag" - "io" - "io/ioutil" - "log" - "net/http" - "os" - "os/exec" - "path" - "strings" - - "github.com/elazarl/goproxy" -) - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - java := flag.String("javapath", "java", "where the Java executable is located") - yuicompressor := flag.String("yuicompressor", "", "where the yuicompressor is located, assumed to be in CWD") - yuicompressordir := flag.String("yuicompressordir", ".", "a folder to search yuicompressor in, will be ignored if yuicompressor is set") - flag.Parse() - if *yuicompressor == "" { - files, err := ioutil.ReadDir(*yuicompressordir) - if err != nil { - log.Fatal("Cannot find yuicompressor jar") - } - for _, file := range files { - if strings.HasPrefix(file.Name(), "yuicompressor") && strings.HasSuffix(file.Name(), ".jar") { - c := path.Join(*yuicompressordir, file.Name()) - yuicompressor = &c - break - } - } - } - if *yuicompressor == "" { - log.Fatal("Can't find yuicompressor jar, searched yuicompressor*.jar in dir ", *yuicompressordir) - } - if _, err := os.Stat(*yuicompressor); os.IsNotExist(err) { - log.Fatal("Can't find yuicompressor jar specified ", *yuicompressor) - } - proxy := goproxy.NewProxyHttpServer() - proxy.Verbose = *verbose - proxy.OnResponse().DoFunc(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - contentType := resp.Header.Get("Content-Type") - if contentType == "application/javascript" || contentType == "application/x-javascript" { - // in real code, response should be streamed as well - var err error - cmd := exec.Command(*java, "-jar", *yuicompressor, "--type", "js") - cmd.Stdin = resp.Body - resp.Body, err = cmd.StdoutPipe() - if err != nil { - ctx.Warnf("Cannot minify content in %v: %v", ctx.Req.URL, err) - return goproxy.TextResponse(ctx.Req, "Error getting stdout pipe") - } - stderr, err := cmd.StderrPipe() - if err != nil { - ctx.Logf("Error obtaining stderr from yuicompress: %s", err) - return goproxy.TextResponse(ctx.Req, "Error getting stderr pipe") - } - if err := cmd.Start(); err != nil { - ctx.Warnf("Cannot minify content in %v: %v", ctx.Req.URL, err) - } - go func() { - defer stderr.Close() - const kb = 1024 - msg, err := ioutil.ReadAll(&io.LimitedReader{stderr, 50 * kb}) - if len(msg) != 0 { - ctx.Logf("Error executing yuicompress: %s", string(msg)) - } - if err != nil { - ctx.Logf("Error reading stderr from yuicompress: %s", string(msg)) - } - }() - } - return resp - }) - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/vendor/github.com/elazarl/goproxy/ext/auth/basic.go b/vendor/github.com/elazarl/goproxy/ext/auth/basic.go deleted file mode 100644 index 4833763e2a8..00000000000 --- a/vendor/github.com/elazarl/goproxy/ext/auth/basic.go +++ /dev/null @@ -1,76 +0,0 @@ -package auth - -import ( - "bytes" - "encoding/base64" - "io/ioutil" - "net/http" - "strings" - - "github.com/elazarl/goproxy" -) - -var unauthorizedMsg = []byte("407 Proxy Authentication Required") - -func BasicUnauthorized(req *http.Request, realm string) *http.Response { - // TODO(elazar): verify realm is well formed - return &http.Response{ - StatusCode: 407, - ProtoMajor: 1, - ProtoMinor: 1, - Request: req, - Header: http.Header{"Proxy-Authenticate": []string{"Basic realm=" + realm}}, - Body: ioutil.NopCloser(bytes.NewBuffer(unauthorizedMsg)), - ContentLength: int64(len(unauthorizedMsg)), - } -} - -var proxyAuthorizatonHeader = "Proxy-Authorization" - -func auth(req *http.Request, f func(user, passwd string) bool) bool { - authheader := strings.SplitN(req.Header.Get(proxyAuthorizatonHeader), " ", 2) - req.Header.Del(proxyAuthorizatonHeader) - if len(authheader) != 2 || authheader[0] != "Basic" { - return false - } - userpassraw, err := base64.StdEncoding.DecodeString(authheader[1]) - if err != nil { - return false - } - userpass := strings.SplitN(string(userpassraw), ":", 2) - if len(userpass) != 2 { - return false - } - return f(userpass[0], userpass[1]) -} - -// Basic returns a basic HTTP authentication handler for requests -// -// You probably want to use auth.ProxyBasic(proxy) to enable authentication for all proxy activities -func Basic(realm string, f func(user, passwd string) bool) goproxy.ReqHandler { - return goproxy.FuncReqHandler(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - if !auth(req, f) { - return nil, BasicUnauthorized(req, realm) - } - return req, nil - }) -} - -// BasicConnect returns a basic HTTP authentication handler for CONNECT requests -// -// You probably want to use auth.ProxyBasic(proxy) to enable authentication for all proxy activities -func BasicConnect(realm string, f func(user, passwd string) bool) goproxy.HttpsHandler { - return goproxy.FuncHttpsHandler(func(host string, ctx *goproxy.ProxyCtx) (*goproxy.ConnectAction, string) { - if !auth(ctx.Req, f) { - ctx.Resp = BasicUnauthorized(ctx.Req, realm) - return goproxy.RejectConnect, host - } - return goproxy.OkConnect, host - }) -} - -// ProxyBasic will force HTTP authentication before any request to the proxy is processed -func ProxyBasic(proxy *goproxy.ProxyHttpServer, realm string, f func(user, passwd string) bool) { - proxy.OnRequest().Do(Basic(realm, f)) - proxy.OnRequest().HandleConnect(BasicConnect(realm, f)) -} diff --git a/vendor/github.com/elazarl/goproxy/ext/html/cp1255.html b/vendor/github.com/elazarl/goproxy/ext/html/cp1255.html deleted file mode 100644 index 6bf33e81b55..00000000000 --- a/vendor/github.com/elazarl/goproxy/ext/html/cp1255.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - - " - - - - - - - - - - - - - - - - - -
- - -
- -
- - - -
-
- - -rss -
- -
- - - - -
-
-
-   2012 . " . -(4.3.12) -
-
- - - - - - -
- - -
-
- -
- - -
- - -
- - - - - - - diff --git a/vendor/github.com/elazarl/goproxy/ext/html/cp1255.txt b/vendor/github.com/elazarl/goproxy/ext/html/cp1255.txt deleted file mode 100644 index ef904ced9e9..00000000000 --- a/vendor/github.com/elazarl/goproxy/ext/html/cp1255.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/vendor/github.com/elazarl/goproxy/ext/html/html.go b/vendor/github.com/elazarl/goproxy/ext/html/html.go deleted file mode 100644 index b438d373410..00000000000 --- a/vendor/github.com/elazarl/goproxy/ext/html/html.go +++ /dev/null @@ -1,104 +0,0 @@ -// extension to goproxy that will allow you to easily filter web browser related content. -package goproxy_html - -import ( - "bytes" - "errors" - "io" - "io/ioutil" - "net/http" - "strings" - - "code.google.com/p/go-charset/charset" - _ "code.google.com/p/go-charset/data" - "github.com/elazarl/goproxy" -) - -var IsHtml goproxy.RespCondition = goproxy.ContentTypeIs("text/html") - -var IsCss goproxy.RespCondition = goproxy.ContentTypeIs("text/css") - -var IsJavaScript goproxy.RespCondition = goproxy.ContentTypeIs("text/javascript", - "application/javascript") - -var IsJson goproxy.RespCondition = goproxy.ContentTypeIs("text/json") - -var IsXml goproxy.RespCondition = goproxy.ContentTypeIs("text/xml") - -var IsWebRelatedText goproxy.RespCondition = goproxy.ContentTypeIs("text/html", - "text/css", - "text/javascript", "application/javascript", - "text/xml", - "text/json") - -// HandleString will receive a function that filters a string, and will convert the -// request body to a utf8 string, according to the charset specified in the Content-Type -// header. -// guessing Html charset encoding from the tags is not yet implemented. -func HandleString(f func(s string, ctx *goproxy.ProxyCtx) string) goproxy.RespHandler { - return HandleStringReader(func(r io.Reader, ctx *goproxy.ProxyCtx) io.Reader { - b, err := ioutil.ReadAll(r) - if err != nil { - ctx.Warnf("Cannot read string from resp body: %v", err) - return r - } - return bytes.NewBufferString(f(string(b), ctx)) - }) -} - -// Will receive an input stream which would convert the response to utf-8 -// The given function must close the reader r, in order to close the response body. -func HandleStringReader(f func(r io.Reader, ctx *goproxy.ProxyCtx) io.Reader) goproxy.RespHandler { - return goproxy.FuncRespHandler(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - if ctx.Error != nil { - return nil - } - charsetName := ctx.Charset() - if charsetName == "" { - charsetName = "utf-8" - } - - if strings.ToLower(charsetName) != "utf-8" { - r, err := charset.NewReader(charsetName, resp.Body) - if err != nil { - ctx.Warnf("Cannot convert from %v to utf-8: %v", charsetName, err) - return resp - } - tr, err := charset.TranslatorTo(charsetName) - if err != nil { - ctx.Warnf("Can't translate to %v from utf-8: %v", charsetName, err) - return resp - } - if err != nil { - ctx.Warnf("Cannot translate to %v: %v", charsetName, err) - return resp - } - newr := charset.NewTranslatingReader(f(r, ctx), tr) - resp.Body = &readFirstCloseBoth{ioutil.NopCloser(newr), resp.Body} - } else { - //no translation is needed, already at utf-8 - resp.Body = &readFirstCloseBoth{ioutil.NopCloser(f(resp.Body, ctx)), resp.Body} - } - return resp - }) -} - -type readFirstCloseBoth struct { - r io.ReadCloser - c io.Closer -} - -func (rfcb *readFirstCloseBoth) Read(b []byte) (nr int, err error) { - return rfcb.r.Read(b) -} -func (rfcb *readFirstCloseBoth) Close() error { - err1 := rfcb.r.Close() - err2 := rfcb.c.Close() - if err1 != nil && err2 != nil { - return errors.New(err1.Error() + ", " + err2.Error()) - } - if err1 != nil { - return err1 - } - return err2 -} diff --git a/vendor/github.com/elazarl/goproxy/ext/image/image.go b/vendor/github.com/elazarl/goproxy/ext/image/image.go deleted file mode 100644 index 3dc26ff3747..00000000000 --- a/vendor/github.com/elazarl/goproxy/ext/image/image.go +++ /dev/null @@ -1,78 +0,0 @@ -package goproxy_image - -import ( - "bytes" - "image" - _ "image/gif" - "image/jpeg" - "image/png" - "io/ioutil" - "net/http" - . "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/regretable" -) - -var RespIsImage = ContentTypeIs("image/gif", - "image/jpeg", - "image/pjpeg", - "application/octet-stream", - "image/png") - -// "image/tiff" tiff support is in external package, and rarely used, so we omitted it - -func HandleImage(f func(img image.Image, ctx *ProxyCtx) image.Image) RespHandler { - return FuncRespHandler(func(resp *http.Response, ctx *ProxyCtx) *http.Response { - if !RespIsImage.HandleResp(resp, ctx) { - return resp - } - if resp.StatusCode != 200 { - // we might get 304 - not modified response without data - return resp - } - contentType := resp.Header.Get("Content-Type") - - const kb = 1024 - regret := regretable.NewRegretableReaderCloserSize(resp.Body, 16*kb) - resp.Body = regret - img, imgType, err := image.Decode(resp.Body) - if err != nil { - regret.Regret() - ctx.Warnf("%s: %s", ctx.Req.Method+" "+ctx.Req.URL.String()+" Image from "+ctx.Req.RequestURI+"content type"+ - contentType+"cannot be decoded returning original image", err) - return resp - } - result := f(img, ctx) - buf := bytes.NewBuffer([]byte{}) - switch contentType { - // No gif image encoder in go - convert to png - case "image/gif", "image/png": - if err := png.Encode(buf, result); err != nil { - ctx.Warnf("Cannot encode image, returning orig %v %v", ctx.Req.URL.String(), err) - return resp - } - resp.Header.Set("Content-Type", "image/png") - case "image/jpeg", "image/pjpeg": - if err := jpeg.Encode(buf, result, nil); err != nil { - ctx.Warnf("Cannot encode image, returning orig %v %v", ctx.Req.URL.String(), err) - return resp - } - case "application/octet-stream": - switch imgType { - case "jpeg": - if err := jpeg.Encode(buf, result, nil); err != nil { - ctx.Warnf("Cannot encode image as jpeg, returning orig %v %v", ctx.Req.URL.String(), err) - return resp - } - case "png", "gif": - if err := png.Encode(buf, result); err != nil { - ctx.Warnf("Cannot encode image as png, returning orig %v %v", ctx.Req.URL.String(), err) - return resp - } - } - default: - panic("unhandlable type" + contentType) - } - resp.Body = ioutil.NopCloser(buf) - return resp - }) -} diff --git a/vendor/github.com/elazarl/goproxy/regretable/regretreader.go b/vendor/github.com/elazarl/goproxy/regretable/regretreader.go deleted file mode 100644 index 1458af58714..00000000000 --- a/vendor/github.com/elazarl/goproxy/regretable/regretreader.go +++ /dev/null @@ -1,97 +0,0 @@ -package regretable - -import ( - "io" -) - -// A RegretableReader will allow you to read from a reader, and then -// to "regret" reading it, and push back everything you've read. -// For example, -// rb := NewRegretableReader(bytes.NewBuffer([]byte{1,2,3})) -// var b = make([]byte,1) -// rb.Read(b) // b[0] = 1 -// rb.Regret() -// ioutil.ReadAll(rb.Read) // returns []byte{1,2,3},nil -type RegretableReader struct { - reader io.Reader - overflow bool - r, w int - buf []byte -} - -var defaultBufferSize = 500 - -// Same as RegretableReader, but allows closing the underlying reader -type RegretableReaderCloser struct { - RegretableReader - c io.Closer -} - -// Closes the underlying readCloser, you cannot regret after closing the stream -func (rbc *RegretableReaderCloser) Close() error { - return rbc.c.Close() -} - -// initialize a RegretableReaderCloser with underlying readCloser rc -func NewRegretableReaderCloser(rc io.ReadCloser) *RegretableReaderCloser { - return &RegretableReaderCloser{*NewRegretableReader(rc), rc} -} - -// initialize a RegretableReaderCloser with underlying readCloser rc -func NewRegretableReaderCloserSize(rc io.ReadCloser, size int) *RegretableReaderCloser { - return &RegretableReaderCloser{*NewRegretableReaderSize(rc, size), rc} -} - -// The next read from the RegretableReader will be as if the underlying reader -// was never read (or from the last point forget is called). -func (rb *RegretableReader) Regret() { - if rb.overflow { - panic("regretting after overflow makes no sense") - } - rb.r = 0 -} - -// Will "forget" everything read so far. -// rb := NewRegretableReader(bytes.NewBuffer([]byte{1,2,3})) -// var b = make([]byte,1) -// rb.Read(b) // b[0] = 1 -// rb.Forget() -// rb.Read(b) // b[0] = 2 -// rb.Regret() -// ioutil.ReadAll(rb.Read) // returns []byte{2,3},nil -func (rb *RegretableReader) Forget() { - if rb.overflow { - panic("forgetting after overflow makes no sense") - } - rb.r = 0 - rb.w = 0 -} - -// initialize a RegretableReader with underlying reader r, whose buffer is size bytes long -func NewRegretableReaderSize(r io.Reader, size int) *RegretableReader { - return &RegretableReader{reader: r, buf: make([]byte, size) } -} - -// initialize a RegretableReader with underlying reader r -func NewRegretableReader(r io.Reader) *RegretableReader { - return NewRegretableReaderSize(r, defaultBufferSize) -} - -// reads from the underlying reader. Will buffer all input until Regret is called. -func (rb *RegretableReader) Read(p []byte) (n int, err error) { - if rb.overflow { - return rb.reader.Read(p) - } - if rb.r < rb.w { - n = copy(p, rb.buf[rb.r:rb.w]) - rb.r += n - return - } - n, err = rb.reader.Read(p) - bn := copy(rb.buf[rb.w:], p[:n]) - rb.w, rb.r = rb.w + bn, rb.w + n - if bn < n { - rb.overflow = true - } - return -} diff --git a/vendor/github.com/elazarl/goproxy/test_data/baby.jpg b/vendor/github.com/elazarl/goproxy/test_data/baby.jpg deleted file mode 100644 index c377bb8e324..00000000000 Binary files a/vendor/github.com/elazarl/goproxy/test_data/baby.jpg and /dev/null differ diff --git a/vendor/github.com/elazarl/goproxy/test_data/football.png b/vendor/github.com/elazarl/goproxy/test_data/football.png deleted file mode 100644 index 7eefac18f7d..00000000000 Binary files a/vendor/github.com/elazarl/goproxy/test_data/football.png and /dev/null differ diff --git a/vendor/github.com/elazarl/goproxy/test_data/panda.png b/vendor/github.com/elazarl/goproxy/test_data/panda.png deleted file mode 100644 index cdfdb5e6812..00000000000 Binary files a/vendor/github.com/elazarl/goproxy/test_data/panda.png and /dev/null differ diff --git a/vendor/github.com/elazarl/goproxy/transport/roundtripper.go b/vendor/github.com/elazarl/goproxy/transport/roundtripper.go deleted file mode 100644 index 3651ad86c0c..00000000000 --- a/vendor/github.com/elazarl/goproxy/transport/roundtripper.go +++ /dev/null @@ -1,19 +0,0 @@ -package transport -import "net/http" -type RoundTripper interface { - // RoundTrip executes a single HTTP transaction, returning - // the Response for the request req. RoundTrip should not - // attempt to interpret the response. In particular, - // RoundTrip must return err == nil if it obtained a response, - // regardless of the response's HTTP status code. A non-nil - // err should be reserved for failure to obtain a response. - // Similarly, RoundTrip should not attempt to handle - // higher-level protocol details such as redirects, - // authentication, or cookies. - // - // RoundTrip should not modify the request, except for - // consuming the Body. The request's URL and Header fields - // are guaranteed to be initialized. - RoundTrip(*http.Request) (*http.Response, error) - DetailedRoundTrip(*http.Request) (*RoundTripDetails, *http.Response, error) -} diff --git a/vendor/github.com/elazarl/goproxy/transport/transport.go b/vendor/github.com/elazarl/goproxy/transport/transport.go deleted file mode 100644 index fc1c82b1a51..00000000000 --- a/vendor/github.com/elazarl/goproxy/transport/transport.go +++ /dev/null @@ -1,789 +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 client implementation. See RFC 2616. -// -// This is the low-level Transport implementation of RoundTripper. -// The high-level interface is in client.go. - -// This file is DEPRECATED and keep solely for backward compatibility. - -package transport - -import ( - "net/http" - "bufio" - "compress/gzip" - "crypto/tls" - "encoding/base64" - "errors" - "fmt" - "io" - "io/ioutil" - "log" - "net" - "net/url" - "os" - "strings" - "sync" -) - -// DefaultTransport is the default implementation of Transport and is -// used by DefaultClient. It establishes a new network connection for -// each call to Do and uses HTTP proxies as directed by the -// $HTTP_PROXY and $NO_PROXY (or $http_proxy and $no_proxy) -// environment variables. -var DefaultTransport RoundTripper = &Transport{Proxy: ProxyFromEnvironment} - -// DefaultMaxIdleConnsPerHost is the default value of Transport's -// MaxIdleConnsPerHost. -const DefaultMaxIdleConnsPerHost = 2 - -// Transport is an implementation of RoundTripper that supports http, -// https, and http proxies (for either http or https with CONNECT). -// Transport can also cache connections for future re-use. -type Transport struct { - lk sync.Mutex - idleConn map[string][]*persistConn - altProto map[string]RoundTripper // nil or map of URI scheme => RoundTripper - - // TODO: tunable on global max cached connections - // TODO: tunable on timeout on cached connections - // TODO: optional pipelining - - // Proxy specifies a function to return a proxy for a given - // Request. If the function returns a non-nil error, the - // request is aborted with the provided error. - // If Proxy is nil or returns a nil *URL, no proxy is used. - Proxy func(*http.Request) (*url.URL, error) - - // Dial specifies the dial function for creating TCP - // connections. - // If Dial is nil, net.Dial is used. - Dial func(net, addr string) (c net.Conn, err error) - - // TLSClientConfig specifies the TLS configuration to use with - // tls.Client. If nil, the default configuration is used. - TLSClientConfig *tls.Config - - DisableKeepAlives bool - DisableCompression bool - - // MaxIdleConnsPerHost, if non-zero, controls the maximum idle - // (keep-alive) to keep to keep per-host. If zero, - // DefaultMaxIdleConnsPerHost is used. - MaxIdleConnsPerHost int -} - -// ProxyFromEnvironment returns the URL of the proxy to use for a -// given request, as indicated by the environment variables -// $HTTP_PROXY and $NO_PROXY (or $http_proxy and $no_proxy). -// An error is returned if the proxy environment is invalid. -// A nil URL and nil error are returned if no proxy is defined in the -// environment, or a proxy should not be used for the given request. -func ProxyFromEnvironment(req *http.Request) (*url.URL, error) { - proxy := getenvEitherCase("HTTP_PROXY") - if proxy == "" { - return nil, nil - } - if !useProxy(canonicalAddr(req.URL)) { - return nil, nil - } - proxyURL, err := url.Parse(proxy) - if err != nil || proxyURL.Scheme == "" { - if u, err := url.Parse("http://" + proxy); err == nil { - proxyURL = u - err = nil - } - } - if err != nil { - return nil, fmt.Errorf("invalid proxy address %q: %v", proxy, err) - } - return proxyURL, nil -} - -// ProxyURL returns a proxy function (for use in a Transport) -// that always returns the same URL. -func ProxyURL(fixedURL *url.URL) func(*http.Request) (*url.URL, error) { - return func(*http.Request) (*url.URL, error) { - return fixedURL, nil - } -} - -// transportRequest is a wrapper around a *Request that adds -// optional extra headers to write. -type transportRequest struct { - *http.Request // original request, not to be mutated - extra http.Header // extra headers to write, or nil -} - -func (tr *transportRequest) extraHeaders() http.Header { - if tr.extra == nil { - tr.extra = make(http.Header) - } - return tr.extra -} - -type RoundTripDetails struct { - Host string - TCPAddr *net.TCPAddr - IsProxy bool - Error error -} - -func (t *Transport) DetailedRoundTrip(req *http.Request) (details *RoundTripDetails, resp *http.Response, err error) { - if req.URL == nil { - return nil, nil, errors.New("http: nil Request.URL") - } - if req.Header == nil { - return nil, nil, errors.New("http: nil Request.Header") - } - if req.URL.Scheme != "http" && req.URL.Scheme != "https" { - t.lk.Lock() - var rt RoundTripper - if t.altProto != nil { - rt = t.altProto[req.URL.Scheme] - } - t.lk.Unlock() - if rt == nil { - return nil, nil, &badStringError{"unsupported protocol scheme", req.URL.Scheme} - } - return rt.DetailedRoundTrip(req) - } - treq := &transportRequest{Request: req} - cm, err := t.connectMethodForRequest(treq) - if err != nil { - return nil, nil, err - } - - // Get the cached or newly-created connection to either the - // host (for http or https), the http proxy, or the http proxy - // pre-CONNECTed to https server. In any case, we'll be ready - // to send it requests. - pconn, err := t.getConn(cm) - if err != nil { - return nil, nil, err - } - - resp, err = pconn.roundTrip(treq) - return &RoundTripDetails{pconn.host, pconn.ip, pconn.isProxy, err}, resp, err -} - -// RoundTrip implements the RoundTripper interface. -func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error) { - _, resp, err = t.DetailedRoundTrip(req) - return -} - -// RegisterProtocol registers a new protocol with scheme. -// The Transport will pass requests using the given scheme to rt. -// It is rt's responsibility to simulate HTTP request semantics. -// -// RegisterProtocol can be used by other packages to provide -// implementations of protocol schemes like "ftp" or "file". -func (t *Transport) RegisterProtocol(scheme string, rt RoundTripper) { - if scheme == "http" || scheme == "https" { - panic("protocol " + scheme + " already registered") - } - t.lk.Lock() - defer t.lk.Unlock() - if t.altProto == nil { - t.altProto = make(map[string]RoundTripper) - } - if _, exists := t.altProto[scheme]; exists { - panic("protocol " + scheme + " already registered") - } - t.altProto[scheme] = rt -} - -// CloseIdleConnections closes any connections which were previously -// connected from previous requests but are now sitting idle in -// a "keep-alive" state. It does not interrupt any connections currently -// in use. -func (t *Transport) CloseIdleConnections() { - t.lk.Lock() - defer t.lk.Unlock() - if t.idleConn == nil { - return - } - for _, conns := range t.idleConn { - for _, pconn := range conns { - pconn.close() - } - } - t.idleConn = make(map[string][]*persistConn) -} - -// -// Private implementation past this point. -// - -func getenvEitherCase(k string) string { - if v := os.Getenv(strings.ToUpper(k)); v != "" { - return v - } - return os.Getenv(strings.ToLower(k)) -} - -func (t *Transport) connectMethodForRequest(treq *transportRequest) (*connectMethod, error) { - cm := &connectMethod{ - targetScheme: treq.URL.Scheme, - targetAddr: canonicalAddr(treq.URL), - } - if t.Proxy != nil { - var err error - cm.proxyURL, err = t.Proxy(treq.Request) - if err != nil { - return nil, err - } - } - return cm, nil -} - -// proxyAuth returns the Proxy-Authorization header to set -// on requests, if applicable. -func (cm *connectMethod) proxyAuth() string { - if cm.proxyURL == nil { - return "" - } - if u := cm.proxyURL.User; u != nil { - return "Basic " + base64.URLEncoding.EncodeToString([]byte(u.String())) - } - return "" -} - -// putIdleConn adds pconn to the list of idle persistent connections awaiting -// a new request. -// If pconn is no longer needed or not in a good state, putIdleConn -// returns false. -func (t *Transport) putIdleConn(pconn *persistConn) bool { - t.lk.Lock() - defer t.lk.Unlock() - if t.DisableKeepAlives || t.MaxIdleConnsPerHost < 0 { - pconn.close() - return false - } - if pconn.isBroken() { - return false - } - key := pconn.cacheKey - max := t.MaxIdleConnsPerHost - if max == 0 { - max = DefaultMaxIdleConnsPerHost - } - if len(t.idleConn[key]) >= max { - pconn.close() - return false - } - t.idleConn[key] = append(t.idleConn[key], pconn) - return true -} - -func (t *Transport) getIdleConn(cm *connectMethod) (pconn *persistConn) { - t.lk.Lock() - defer t.lk.Unlock() - if t.idleConn == nil { - t.idleConn = make(map[string][]*persistConn) - } - key := cm.String() - for { - pconns, ok := t.idleConn[key] - if !ok { - return nil - } - if len(pconns) == 1 { - pconn = pconns[0] - delete(t.idleConn, key) - } else { - // 2 or more cached connections; pop last - // TODO: queue? - pconn = pconns[len(pconns)-1] - t.idleConn[key] = pconns[0 : len(pconns)-1] - } - if !pconn.isBroken() { - return - } - } - return -} - -func (t *Transport) dial(network, addr string) (c net.Conn, raddr string, ip *net.TCPAddr, err error) { - if t.Dial != nil { - ip, err = net.ResolveTCPAddr("tcp", addr) - if err!=nil { - return - } - c, err = t.Dial(network, addr) - raddr = addr - return - } - addri, err := net.ResolveTCPAddr("tcp", addr) - if err!=nil { - return - } - c, err = net.DialTCP("tcp", nil, addri) - raddr = addr - ip = addri - return -} - -// getConn dials and creates a new persistConn to the target as -// specified in the connectMethod. This includes doing a proxy CONNECT -// and/or setting up TLS. If this doesn't return an error, the persistConn -// is ready to write requests to. -func (t *Transport) getConn(cm *connectMethod) (*persistConn, error) { - if pc := t.getIdleConn(cm); pc != nil { - return pc, nil - } - - conn, raddr, ip, err := t.dial("tcp", cm.addr()) - if err != nil { - if cm.proxyURL != nil { - err = fmt.Errorf("http: error connecting to proxy %s: %v", cm.proxyURL, err) - } - return nil, err - } - - pa := cm.proxyAuth() - - pconn := &persistConn{ - t: t, - cacheKey: cm.String(), - conn: conn, - reqch: make(chan requestAndChan, 50), - host: raddr, - ip: ip, - } - - switch { - case cm.proxyURL == nil: - // Do nothing. - case cm.targetScheme == "http": - pconn.isProxy = true - if pa != "" { - pconn.mutateHeaderFunc = func(h http.Header) { - h.Set("Proxy-Authorization", pa) - } - } - case cm.targetScheme == "https": - connectReq := &http.Request{ - Method: "CONNECT", - URL: &url.URL{Opaque: cm.targetAddr}, - Host: cm.targetAddr, - Header: make(http.Header), - } - if pa != "" { - connectReq.Header.Set("Proxy-Authorization", pa) - } - connectReq.Write(conn) - - // Read response. - // Okay to use and discard buffered reader here, because - // TLS server will not speak until spoken to. - br := bufio.NewReader(conn) - resp, err := http.ReadResponse(br, connectReq) - if err != nil { - conn.Close() - return nil, err - } - if resp.StatusCode != 200 { - f := strings.SplitN(resp.Status, " ", 2) - conn.Close() - return nil, errors.New(f[1]) - } - } - - if cm.targetScheme == "https" { - // Initiate TLS and check remote host name against certificate. - conn = tls.Client(conn, t.TLSClientConfig) - if err = conn.(*tls.Conn).Handshake(); err != nil { - return nil, err - } - if t.TLSClientConfig == nil || !t.TLSClientConfig.InsecureSkipVerify { - if err = conn.(*tls.Conn).VerifyHostname(cm.tlsHost()); err != nil { - return nil, err - } - } - pconn.conn = conn - } - - pconn.br = bufio.NewReader(pconn.conn) - pconn.bw = bufio.NewWriter(pconn.conn) - go pconn.readLoop() - return pconn, nil -} - -// useProxy returns true if requests to addr should use a proxy, -// according to the NO_PROXY or no_proxy environment variable. -// addr is always a canonicalAddr with a host and port. -func useProxy(addr string) bool { - if len(addr) == 0 { - return true - } - host, _, err := net.SplitHostPort(addr) - if err != nil { - return false - } - if host == "localhost" { - return false - } - if ip := net.ParseIP(host); ip != nil { - if ip.IsLoopback() { - return false - } - } - - no_proxy := getenvEitherCase("NO_PROXY") - if no_proxy == "*" { - return false - } - - addr = strings.ToLower(strings.TrimSpace(addr)) - if hasPort(addr) { - addr = addr[:strings.LastIndex(addr, ":")] - } - - for _, p := range strings.Split(no_proxy, ",") { - p = strings.ToLower(strings.TrimSpace(p)) - if len(p) == 0 { - continue - } - if hasPort(p) { - p = p[:strings.LastIndex(p, ":")] - } - if addr == p || (p[0] == '.' && (strings.HasSuffix(addr, p) || addr == p[1:])) { - return false - } - } - return true -} - -// connectMethod is the map key (in its String form) for keeping persistent -// TCP connections alive for subsequent HTTP requests. -// -// A connect method may be of the following types: -// -// Cache key form Description -// ----------------- ------------------------- -// ||http|foo.com http directly to server, no proxy -// ||https|foo.com https directly to server, no proxy -// http://proxy.com|https|foo.com http to proxy, then CONNECT to foo.com -// http://proxy.com|http http to proxy, http to anywhere after that -// -// Note: no support to https to the proxy yet. -// -type connectMethod struct { - proxyURL *url.URL // nil for no proxy, else full proxy URL - targetScheme string // "http" or "https" - targetAddr string // Not used if proxy + http targetScheme (4th example in table) -} - -func (ck *connectMethod) String() string { - proxyStr := "" - if ck.proxyURL != nil { - proxyStr = ck.proxyURL.String() - } - return strings.Join([]string{proxyStr, ck.targetScheme, ck.targetAddr}, "|") -} - -// addr returns the first hop "host:port" to which we need to TCP connect. -func (cm *connectMethod) addr() string { - if cm.proxyURL != nil { - return canonicalAddr(cm.proxyURL) - } - return cm.targetAddr -} - -// tlsHost returns the host name to match against the peer's -// TLS certificate. -func (cm *connectMethod) tlsHost() string { - h := cm.targetAddr - if hasPort(h) { - h = h[:strings.LastIndex(h, ":")] - } - return h -} - -// persistConn wraps a connection, usually a persistent one -// (but may be used for non-keep-alive requests as well) -type persistConn struct { - t *Transport - cacheKey string // its connectMethod.String() - conn net.Conn - br *bufio.Reader // from conn - bw *bufio.Writer // to conn - reqch chan requestAndChan // written by roundTrip(); read by readLoop() - isProxy bool - - // mutateHeaderFunc is an optional func to modify extra - // headers on each outbound request before it's written. (the - // original Request given to RoundTrip is not modified) - mutateHeaderFunc func(http.Header) - - lk sync.Mutex // guards numExpectedResponses and broken - numExpectedResponses int - broken bool // an error has happened on this connection; marked broken so it's not reused. - - host string - ip *net.TCPAddr -} - -func (pc *persistConn) isBroken() bool { - pc.lk.Lock() - defer pc.lk.Unlock() - return pc.broken -} - -var remoteSideClosedFunc func(error) bool // or nil to use default - -func remoteSideClosed(err error) bool { - if err == io.EOF { - return true - } - if remoteSideClosedFunc != nil { - return remoteSideClosedFunc(err) - } - return false -} - -func (pc *persistConn) readLoop() { - alive := true - var lastbody io.ReadCloser // last response body, if any, read on this connection - - for alive { - pb, err := pc.br.Peek(1) - - pc.lk.Lock() - if pc.numExpectedResponses == 0 { - pc.closeLocked() - pc.lk.Unlock() - if len(pb) > 0 { - log.Printf("Unsolicited response received on idle HTTP channel starting with %q; err=%v", - string(pb), err) - } - return - } - pc.lk.Unlock() - - rc := <-pc.reqch - - // Advance past the previous response's body, if the - // caller hasn't done so. - if lastbody != nil { - lastbody.Close() // assumed idempotent - lastbody = nil - } - resp, err := http.ReadResponse(pc.br, rc.req) - - if err != nil { - pc.close() - } else { - hasBody := rc.req.Method != "HEAD" && resp.ContentLength != 0 - if rc.addedGzip && hasBody && resp.Header.Get("Content-Encoding") == "gzip" { - resp.Header.Del("Content-Encoding") - resp.Header.Del("Content-Length") - resp.ContentLength = -1 - gzReader, zerr := gzip.NewReader(resp.Body) - if zerr != nil { - pc.close() - err = zerr - } else { - resp.Body = &readFirstCloseBoth{&discardOnCloseReadCloser{gzReader}, resp.Body} - } - } - resp.Body = &bodyEOFSignal{body: resp.Body} - } - - if err != nil || resp.Close || rc.req.Close { - alive = false - } - - hasBody := resp != nil && resp.ContentLength != 0 - var waitForBodyRead chan bool - if alive { - if hasBody { - lastbody = resp.Body - waitForBodyRead = make(chan bool) - resp.Body.(*bodyEOFSignal).fn = func() { - if !pc.t.putIdleConn(pc) { - alive = false - } - waitForBodyRead <- true - } - } else { - // When there's no response body, we immediately - // reuse the TCP connection (putIdleConn), but - // we need to prevent ClientConn.Read from - // closing the Response.Body on the next - // loop, otherwise it might close the body - // before the client code has had a chance to - // read it (even though it'll just be 0, EOF). - lastbody = nil - - if !pc.t.putIdleConn(pc) { - alive = false - } - } - } - - rc.ch <- responseAndError{resp, err} - - // Wait for the just-returned response body to be fully consumed - // before we race and peek on the underlying bufio reader. - if waitForBodyRead != nil { - <-waitForBodyRead - } - } -} - -type responseAndError struct { - res *http.Response - err error -} - -type requestAndChan struct { - req *http.Request - ch chan responseAndError - - // did the Transport (as opposed to the client code) add an - // Accept-Encoding gzip header? only if it we set it do - // we transparently decode the gzip. - addedGzip bool -} - -func (pc *persistConn) roundTrip(req *transportRequest) (resp *http.Response, err error) { - if pc.mutateHeaderFunc != nil { - panic("mutateHeaderFunc not supported in modified Transport") - pc.mutateHeaderFunc(req.extraHeaders()) - } - - // Ask for a compressed version if the caller didn't set their - // own value for Accept-Encoding. We only attempted to - // uncompress the gzip stream if we were the layer that - // requested it. - requestedGzip := false - if !pc.t.DisableCompression && req.Header.Get("Accept-Encoding") == "" { - // Request gzip only, not deflate. Deflate is ambiguous and - // not as universally supported anyway. - // See: http://www.gzip.org/zlib/zlib_faq.html#faq38 - requestedGzip = true - req.extraHeaders().Set("Accept-Encoding", "gzip") - } - - pc.lk.Lock() - pc.numExpectedResponses++ - pc.lk.Unlock() - - // orig: err = req.Request.write(pc.bw, pc.isProxy, req.extra) - if pc.isProxy { - err = req.Request.WriteProxy(pc.bw) - } else { - err = req.Request.Write(pc.bw) - } - if err != nil { - pc.close() - return - } - pc.bw.Flush() - - ch := make(chan responseAndError, 1) - pc.reqch <- requestAndChan{req.Request, ch, requestedGzip} - re := <-ch - pc.lk.Lock() - pc.numExpectedResponses-- - pc.lk.Unlock() - - return re.res, re.err -} - -func (pc *persistConn) close() { - pc.lk.Lock() - defer pc.lk.Unlock() - pc.closeLocked() -} - -func (pc *persistConn) closeLocked() { - pc.broken = true - pc.conn.Close() - pc.mutateHeaderFunc = nil -} - -var portMap = map[string]string{ - "http": "80", - "https": "443", -} - -// canonicalAddr returns url.Host but always with a ":port" suffix -func canonicalAddr(url *url.URL) string { - addr := url.Host - if !hasPort(addr) { - return addr + ":" + portMap[url.Scheme] - } - return addr -} - -func responseIsKeepAlive(res *http.Response) bool { - // TODO: implement. for now just always shutting down the connection. - return false -} - -// bodyEOFSignal wraps a ReadCloser but runs fn (if non-nil) at most -// once, right before the final Read() or Close() call returns, but after -// EOF has been seen. -type bodyEOFSignal struct { - body io.ReadCloser - fn func() - isClosed bool -} - -func (es *bodyEOFSignal) Read(p []byte) (n int, err error) { - n, err = es.body.Read(p) - if es.isClosed && n > 0 { - panic("http: unexpected bodyEOFSignal Read after Close; see issue 1725") - } - if err == io.EOF && es.fn != nil { - es.fn() - es.fn = nil - } - return -} - -func (es *bodyEOFSignal) Close() (err error) { - if es.isClosed { - return nil - } - es.isClosed = true - err = es.body.Close() - if err == nil && es.fn != nil { - es.fn() - es.fn = nil - } - return -} - -type readFirstCloseBoth struct { - io.ReadCloser - io.Closer -} - -func (r *readFirstCloseBoth) Close() error { - if err := r.ReadCloser.Close(); err != nil { - r.Closer.Close() - return err - } - if err := r.Closer.Close(); err != nil { - return err - } - return nil -} - -// discardOnCloseReadCloser consumes all its input on Close. -type discardOnCloseReadCloser struct { - io.ReadCloser -} - -func (d *discardOnCloseReadCloser) Close() error { - io.Copy(ioutil.Discard, d.ReadCloser) // ignore errors; likely invalid or already closed - return d.ReadCloser.Close() -} diff --git a/vendor/github.com/elazarl/goproxy/transport/util.go b/vendor/github.com/elazarl/goproxy/transport/util.go deleted file mode 100644 index af0eda1ee68..00000000000 --- a/vendor/github.com/elazarl/goproxy/transport/util.go +++ /dev/null @@ -1,15 +0,0 @@ -package transport - -import ( - "fmt" - "strings" -) - -type badStringError struct { - what string - str string -} - -func (e *badStringError) Error() string { return fmt.Sprintf("%s %q", e.what, e.str) } - -func hasPort(s string) bool { return strings.LastIndex(s, ":") > strings.LastIndex(s, "]") } diff --git a/vendor/github.com/emicklei/go-restful/examples/.goconvey b/vendor/github.com/emicklei/go-restful/examples/.goconvey deleted file mode 100644 index 8485e986e45..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/.goconvey +++ /dev/null @@ -1 +0,0 @@ -ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/.goconvey b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/.goconvey deleted file mode 100644 index 8485e986e45..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/.goconvey +++ /dev/null @@ -1 +0,0 @@ -ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/app.yaml b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/app.yaml deleted file mode 100644 index 362db6b078a..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/app.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# -# Include your application ID here -# -application: -version: 1 -runtime: go -api_version: go1 - -handlers: -# -# Regex for all swagger files to make as static content. -# You should create the folder static/swagger and copy -# swagger-ui into it. -# -- url: /apidocs/(.*?)/(.*\.(js|html|css)) - static_files: static/swagger/\1/\2 - upload: static/swagger/(.*?)/(.*\.(js|html|css)) - -- url: /.* - script: _go_app diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/.goconvey b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/.goconvey deleted file mode 100644 index 8485e986e45..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/.goconvey +++ /dev/null @@ -1 +0,0 @@ -ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/app.yaml b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/app.yaml deleted file mode 100644 index 1ac9dca28f3..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/app.yaml +++ /dev/null @@ -1,18 +0,0 @@ -application: -version: 1 -runtime: go -api_version: go1 - -handlers: -# Regex for all swagger files to make as static content. -# You should create the folder static/swagger and copy -# swagger-ui into it. -# -- url: /apidocs/(.*?)/(.*\.(js|html|css)) - static_files: static/swagger/\1/\2 - upload: static/swagger/(.*?)/(.*\.(js|html|css)) - -# Catch all. -- url: /.* - script: _go_app - login: required diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/main.go b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/main.go deleted file mode 100644 index ca290818098..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/datastore/main.go +++ /dev/null @@ -1,266 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "github.com/emicklei/go-restful/swagger" - "google.golang.org/appengine" - "google.golang.org/appengine/datastore" - "google.golang.org/appengine/user" - "net/http" - "time" -) - -// This example demonstrates a reasonably complete suite of RESTful operations backed -// by DataStore on Google App Engine. - -// Our simple example struct. -type Profile struct { - LastModified time.Time `json:"-" xml:"-"` - Email string `json:"-" xml:"-"` - FirstName string `json:"first_name" xml:"first-name"` - NickName string `json:"nick_name" xml:"nick-name"` - LastName string `json:"last_name" xml:"last-name"` -} - -type ProfileApi struct { - Path string -} - -func gaeUrl() string { - if appengine.IsDevAppServer() { - return "http://localhost:8080" - } else { - // Include your URL on App Engine here. - // I found no way to get AppID without appengine.Context and this always - // based on a http.Request. - return "http://federatedservices.appspot.com" - } -} - -func init() { - u := ProfileApi{Path: "/profiles"} - u.register() - - // Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open .appspot.com/apidocs and enter - // Place the Swagger UI files into a folder called static/swagger if you wish to use Swagger - // http://.appspot.com/apidocs.json in the api input field. - // For testing, you can use http://localhost:8080/apidocs.json - config := swagger.Config{ - // You control what services are visible - WebServices: restful.RegisteredWebServices(), - WebServicesUrl: gaeUrl(), - ApiPath: "/apidocs.json", - - // Optionally, specifiy where the UI is located - SwaggerPath: "/apidocs/", - - // GAE support static content which is configured in your app.yaml. - // This example expect the swagger-ui in static/swagger so you should place it there :) - SwaggerFilePath: "static/swagger"} - swagger.InstallSwaggerService(config) -} - -func (u ProfileApi) register() { - ws := new(restful.WebService) - - ws. - Path(u.Path). - // You can specify consumes and produces per route as well. - Consumes(restful.MIME_JSON, restful.MIME_XML). - Produces(restful.MIME_JSON, restful.MIME_XML) - - ws.Route(ws.POST("").To(u.insert). - // Swagger documentation. - Doc("insert a new profile"). - Param(ws.BodyParameter("Profile", "representation of a profile").DataType("main.Profile")). - Reads(Profile{})) - - ws.Route(ws.GET("/{profile-id}").To(u.read). - // Swagger documentation. - Doc("read a profile"). - Param(ws.PathParameter("profile-id", "identifier for a profile").DataType("string")). - Writes(Profile{})) - - ws.Route(ws.PUT("/{profile-id}").To(u.update). - // Swagger documentation. - Doc("update an existing profile"). - Param(ws.PathParameter("profile-id", "identifier for a profile").DataType("string")). - Param(ws.BodyParameter("Profile", "representation of a profile").DataType("main.Profile")). - Reads(Profile{})) - - ws.Route(ws.DELETE("/{profile-id}").To(u.remove). - // Swagger documentation. - Doc("remove a profile"). - Param(ws.PathParameter("profile-id", "identifier for a profile").DataType("string"))) - - restful.Add(ws) -} - -// POST http://localhost:8080/profiles -// {"first_name": "Ivan", "nick_name": "Socks", "last_name": "Hawkes"} -// -func (u *ProfileApi) insert(r *restful.Request, w *restful.Response) { - c := appengine.NewContext(r.Request) - - // Marshall the entity from the request into a struct. - p := new(Profile) - err := r.ReadEntity(&p) - if err != nil { - w.WriteError(http.StatusNotAcceptable, err) - return - } - - // Ensure we start with a sensible value for this field. - p.LastModified = time.Now() - - // The profile belongs to this user. - p.Email = user.Current(c).String() - - k, err := datastore.Put(c, datastore.NewIncompleteKey(c, "profiles", nil), p) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - // Let them know the location of the newly created resource. - // TODO: Use a safe Url path append function. - w.AddHeader("Location", u.Path+"/"+k.Encode()) - - // Return the resultant entity. - w.WriteHeader(http.StatusCreated) - w.WriteEntity(p) -} - -// GET http://localhost:8080/profiles/ahdkZXZ-ZmVkZXJhdGlvbi1zZXJ2aWNlc3IVCxIIcHJvZmlsZXMYgICAgICAgAoM -// -func (u ProfileApi) read(r *restful.Request, w *restful.Response) { - c := appengine.NewContext(r.Request) - - // Decode the request parameter to determine the key for the entity. - k, err := datastore.DecodeKey(r.PathParameter("profile-id")) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - // Retrieve the entity from the datastore. - p := Profile{} - if err := datastore.Get(c, k, &p); err != nil { - if err.Error() == "datastore: no such entity" { - http.Error(w, err.Error(), http.StatusNotFound) - } else { - http.Error(w, err.Error(), http.StatusInternalServerError) - } - return - } - - // Check we own the profile before allowing them to view it. - // Optionally, return a 404 instead to help prevent guessing ids. - // TODO: Allow admins access. - if p.Email != user.Current(c).String() { - http.Error(w, "You do not have access to this resource", http.StatusForbidden) - return - } - - w.WriteEntity(p) -} - -// PUT http://localhost:8080/profiles/ahdkZXZ-ZmVkZXJhdGlvbi1zZXJ2aWNlc3IVCxIIcHJvZmlsZXMYgICAgICAgAoM -// {"first_name": "Ivan", "nick_name": "Socks", "last_name": "Hawkes"} -// -func (u *ProfileApi) update(r *restful.Request, w *restful.Response) { - c := appengine.NewContext(r.Request) - - // Decode the request parameter to determine the key for the entity. - k, err := datastore.DecodeKey(r.PathParameter("profile-id")) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - // Marshall the entity from the request into a struct. - p := new(Profile) - err = r.ReadEntity(&p) - if err != nil { - w.WriteError(http.StatusNotAcceptable, err) - return - } - - // Retrieve the old entity from the datastore. - old := Profile{} - if err := datastore.Get(c, k, &old); err != nil { - if err.Error() == "datastore: no such entity" { - http.Error(w, err.Error(), http.StatusNotFound) - } else { - http.Error(w, err.Error(), http.StatusInternalServerError) - } - return - } - - // Check we own the profile before allowing them to update it. - // Optionally, return a 404 instead to help prevent guessing ids. - // TODO: Allow admins access. - if old.Email != user.Current(c).String() { - http.Error(w, "You do not have access to this resource", http.StatusForbidden) - return - } - - // Since the whole entity is re-written, we need to assign any invariant fields again - // e.g. the owner of the entity. - p.Email = user.Current(c).String() - - // Keep track of the last modification date. - p.LastModified = time.Now() - - // Attempt to overwrite the old entity. - _, err = datastore.Put(c, k, p) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - // Let them know it succeeded. - w.WriteHeader(http.StatusNoContent) -} - -// DELETE http://localhost:8080/profiles/ahdkZXZ-ZmVkZXJhdGlvbi1zZXJ2aWNlc3IVCxIIcHJvZmlsZXMYgICAgICAgAoM -// -func (u *ProfileApi) remove(r *restful.Request, w *restful.Response) { - c := appengine.NewContext(r.Request) - - // Decode the request parameter to determine the key for the entity. - k, err := datastore.DecodeKey(r.PathParameter("profile-id")) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - // Retrieve the old entity from the datastore. - old := Profile{} - if err := datastore.Get(c, k, &old); err != nil { - if err.Error() == "datastore: no such entity" { - http.Error(w, err.Error(), http.StatusNotFound) - } else { - http.Error(w, err.Error(), http.StatusInternalServerError) - } - return - } - - // Check we own the profile before allowing them to delete it. - // Optionally, return a 404 instead to help prevent guessing ids. - // TODO: Allow admins access. - if old.Email != user.Current(c).String() { - http.Error(w, "You do not have access to this resource", http.StatusForbidden) - return - } - - // Delete the entity. - if err := datastore.Delete(c, k); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - } - - // Success notification. - w.WriteHeader(http.StatusNoContent) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-appstats-integration.go b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-appstats-integration.go deleted file mode 100644 index b3261eeb9f1..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-appstats-integration.go +++ /dev/null @@ -1,13 +0,0 @@ -package main - -import ( - "github.com/mjibson/appstats" -) - - -func stats(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - c := appstats.NewContext(req.Request) - chain.ProcessFilter(req, resp) - c.Stats.Status = resp.StatusCode() - c.Save() -} diff --git a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-user-service.go b/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-user-service.go deleted file mode 100644 index 3f38fd6b2f7..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/google_app_engine/restful-user-service.go +++ /dev/null @@ -1,161 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "github.com/emicklei/go-restful/swagger" - "google.golang.org/appengine" - "google.golang.org/appengine/memcache" - "net/http" -) - -// This example is functionally the same as ../restful-user-service.go -// but it`s supposed to run on Goole App Engine (GAE) -// -// contributed by ivanhawkes - -type User struct { - Id, Name string -} - -type UserService struct { - // normally one would use DAO (data access object) - // but in this example we simple use memcache. -} - -func (u UserService) Register() { - ws := new(restful.WebService) - - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well - - ws.Route(ws.GET("/{user-id}").To(u.findUser). - // docs - Doc("get a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Writes(User{})) // on the response - - ws.Route(ws.PATCH("").To(u.updateUser). - // docs - Doc("update a user"). - Reads(User{})) // from the request - - ws.Route(ws.PUT("/{user-id}").To(u.createUser). - // docs - Doc("create a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Reads(User{})) // from the request - - ws.Route(ws.DELETE("/{user-id}").To(u.removeUser). - // docs - Doc("delete a user"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string"))) - - restful.Add(ws) -} - -// GET http://localhost:8080/users/1 -// -func (u UserService) findUser(request *restful.Request, response *restful.Response) { - c := appengine.NewContext(request.Request) - id := request.PathParameter("user-id") - usr := new(User) - _, err := memcache.Gob.Get(c, id, &usr) - if err != nil || len(usr.Id) == 0 { - response.WriteErrorString(http.StatusNotFound, "User could not be found.") - } else { - response.WriteEntity(usr) - } -} - -// PATCH http://localhost:8080/users -// 1Melissa Raspberry -// -func (u *UserService) updateUser(request *restful.Request, response *restful.Response) { - c := appengine.NewContext(request.Request) - usr := new(User) - err := request.ReadEntity(&usr) - if err == nil { - item := &memcache.Item{ - Key: usr.Id, - Object: &usr, - } - err = memcache.Gob.Set(c, item) - if err != nil { - response.WriteError(http.StatusInternalServerError, err) - return - } - response.WriteEntity(usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa -// -func (u *UserService) createUser(request *restful.Request, response *restful.Response) { - c := appengine.NewContext(request.Request) - usr := User{Id: request.PathParameter("user-id")} - err := request.ReadEntity(&usr) - if err == nil { - item := &memcache.Item{ - Key: usr.Id, - Object: &usr, - } - err = memcache.Gob.Add(c, item) - if err != nil { - response.WriteError(http.StatusInternalServerError, err) - return - } - response.WriteHeader(http.StatusCreated) - response.WriteEntity(usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// DELETE http://localhost:8080/users/1 -// -func (u *UserService) removeUser(request *restful.Request, response *restful.Response) { - c := appengine.NewContext(request.Request) - id := request.PathParameter("user-id") - err := memcache.Delete(c, id) - if err != nil { - response.WriteError(http.StatusInternalServerError, err) - } -} - -func getGaeURL() string { - if appengine.IsDevAppServer() { - return "http://localhost:8080" - } else { - /** - * Include your URL on App Engine here. - * I found no way to get AppID without appengine.Context and this always - * based on a http.Request. - */ - return "http://.appspot.com" - } -} - -func init() { - u := UserService{} - u.Register() - - // Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open .appspot.com/apidocs and enter http://.appspot.com/apidocs.json in the api input field. - config := swagger.Config{ - WebServices: restful.RegisteredWebServices(), // you control what services are visible - WebServicesUrl: getGaeURL(), - ApiPath: "/apidocs.json", - - // Optionally, specifiy where the UI is located - SwaggerPath: "/apidocs/", - // GAE support static content which is configured in your app.yaml. - // This example expect the swagger-ui in static/swagger so you should place it there :) - SwaggerFilePath: "static/swagger"} - swagger.InstallSwaggerService(config) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/home.html b/vendor/github.com/emicklei/go-restful/examples/home.html deleted file mode 100644 index e5d49b42ca2..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/home.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - -

{{.Text}}

- - \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-CORS-filter.go b/vendor/github.com/emicklei/go-restful/examples/restful-CORS-filter.go deleted file mode 100644 index 6419d253817..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-CORS-filter.go +++ /dev/null @@ -1,68 +0,0 @@ -package main - -import ( - "io" - "log" - "net/http" - - "github.com/emicklei/go-restful" -) - -// Cross-origin resource sharing (CORS) is a mechanism that allows JavaScript on a web page -// to make XMLHttpRequests to another domain, not the domain the JavaScript originated from. -// -// http://en.wikipedia.org/wiki/Cross-origin_resource_sharing -// http://enable-cors.org/server.html -// -// GET http://localhost:8080/users -// -// GET http://localhost:8080/users/1 -// -// PUT http://localhost:8080/users/1 -// -// DELETE http://localhost:8080/users/1 -// -// OPTIONS http://localhost:8080/users/1 with Header "Origin" set to some domain and - -type UserResource struct{} - -func (u UserResource) RegisterTo(container *restful.Container) { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes("*/*"). - Produces("*/*") - - ws.Route(ws.GET("/{user-id}").To(u.nop)) - ws.Route(ws.POST("").To(u.nop)) - ws.Route(ws.PUT("/{user-id}").To(u.nop)) - ws.Route(ws.DELETE("/{user-id}").To(u.nop)) - - container.Add(ws) -} - -func (u UserResource) nop(request *restful.Request, response *restful.Response) { - io.WriteString(response.ResponseWriter, "this would be a normal response") -} - -func main() { - wsContainer := restful.NewContainer() - u := UserResource{} - u.RegisterTo(wsContainer) - - // Add container filter to enable CORS - cors := restful.CrossOriginResourceSharing{ - ExposeHeaders: []string{"X-My-Header"}, - AllowedHeaders: []string{"Content-Type", "Accept"}, - AllowedMethods: []string{"GET", "POST"}, - CookiesAllowed: false, - Container: wsContainer} - wsContainer.Filter(cors.Filter) - - // Add container filter to respond to OPTIONS - wsContainer.Filter(wsContainer.OPTIONSFilter) - - log.Printf("start listening on localhost:8080") - server := &http.Server{Addr: ":8080", Handler: wsContainer} - log.Fatal(server.ListenAndServe()) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-NCSA-logging.go b/vendor/github.com/emicklei/go-restful/examples/restful-NCSA-logging.go deleted file mode 100644 index 0cda50d342f..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-NCSA-logging.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" - "os" - "strings" - "time" -) - -// This example shows how to create a filter that produces log lines -// according to the Common Log Format, also known as the NCSA standard. -// -// kindly contributed by leehambley -// -// GET http://localhost:8080/ping - -var logger *log.Logger = log.New(os.Stdout, "", 0) - -func NCSACommonLogFormatLogger() restful.FilterFunction { - return func(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - var username = "-" - if req.Request.URL.User != nil { - if name := req.Request.URL.User.Username(); name != "" { - username = name - } - } - chain.ProcessFilter(req, resp) - logger.Printf("%s - %s [%s] \"%s %s %s\" %d %d", - strings.Split(req.Request.RemoteAddr, ":")[0], - username, - time.Now().Format("02/Jan/2006:15:04:05 -0700"), - req.Request.Method, - req.Request.URL.RequestURI(), - req.Request.Proto, - resp.StatusCode(), - resp.ContentLength(), - ) - } -} - -func main() { - ws := new(restful.WebService) - ws.Filter(NCSACommonLogFormatLogger()) - ws.Route(ws.GET("/ping").To(hello)) - restful.Add(ws) - http.ListenAndServe(":8080", nil) -} - -func hello(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "pong") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-basic-authentication.go b/vendor/github.com/emicklei/go-restful/examples/restful-basic-authentication.go deleted file mode 100644 index 5dd3067e955..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-basic-authentication.go +++ /dev/null @@ -1,35 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "net/http" -) - -// This example shows how to create a (Route) Filter that performs Basic Authentication on the Http request. -// -// GET http://localhost:8080/secret -// and use admin,admin for the credentials - -func main() { - ws := new(restful.WebService) - ws.Route(ws.GET("/secret").Filter(basicAuthenticate).To(secret)) - restful.Add(ws) - http.ListenAndServe(":8080", nil) -} - -func basicAuthenticate(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - encoded := req.Request.Header.Get("Authorization") - // usr/pwd = admin/admin - // real code does some decoding - if len(encoded) == 0 || "Basic YWRtaW46YWRtaW4=" != encoded { - resp.AddHeader("WWW-Authenticate", "Basic realm=Protected Area") - resp.WriteErrorString(401, "401: Not Authorized") - return - } - chain.ProcessFilter(req, resp) -} - -func secret(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "42") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-cpuprofiler-service.go b/vendor/github.com/emicklei/go-restful/examples/restful-cpuprofiler-service.go deleted file mode 100644 index 9148213cf01..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-cpuprofiler-service.go +++ /dev/null @@ -1,65 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "os" - "runtime/pprof" -) - -// ProfilingService is a WebService that can start/stop a CPU profile and write results to a file -// GET /{rootPath}/start will activate CPU profiling -// GET /{rootPath}/stop will stop profiling -// -// NewProfileService("/profiler", "ace.prof").AddWebServiceTo(restful.DefaultContainer) -// -type ProfilingService struct { - rootPath string // the base (root) of the service, e.g. /profiler - cpuprofile string // the output filename to write profile results, e.g. myservice.prof - cpufile *os.File // if not nil, then profiling is active -} - -func NewProfileService(rootPath string, outputFilename string) *ProfilingService { - ps := new(ProfilingService) - ps.rootPath = rootPath - ps.cpuprofile = outputFilename - return ps -} - -// Add this ProfileService to a restful Container -func (p ProfilingService) AddWebServiceTo(container *restful.Container) { - ws := new(restful.WebService) - ws.Path(p.rootPath).Consumes("*/*").Produces(restful.MIME_JSON) - ws.Route(ws.GET("/start").To(p.startProfiler)) - ws.Route(ws.GET("/stop").To(p.stopProfiler)) - container.Add(ws) -} - -func (p *ProfilingService) startProfiler(req *restful.Request, resp *restful.Response) { - if p.cpufile != nil { - io.WriteString(resp.ResponseWriter, "[restful] CPU profiling already running") - return // error? - } - cpufile, err := os.Create(p.cpuprofile) - if err != nil { - log.Fatal(err) - } - // remember for close - p.cpufile = cpufile - pprof.StartCPUProfile(cpufile) - io.WriteString(resp.ResponseWriter, "[restful] CPU profiling started, writing on:"+p.cpuprofile) -} - -func (p *ProfilingService) stopProfiler(req *restful.Request, resp *restful.Response) { - if p.cpufile == nil { - io.WriteString(resp.ResponseWriter, "[restful] CPU profiling not active") - return // error? - } - pprof.StopCPUProfile() - p.cpufile.Close() - p.cpufile = nil - io.WriteString(resp.ResponseWriter, "[restful] CPU profiling stopped, closing:"+p.cpuprofile) -} - -func main() {} // exists for example compilation only diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-curly-router.go b/vendor/github.com/emicklei/go-restful/examples/restful-curly-router.go deleted file mode 100644 index 1b95dd02b6b..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-curly-router.go +++ /dev/null @@ -1,107 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "log" - "net/http" -) - -// This example has the same service definition as restful-user-resource -// but uses a different router (CurlyRouter) that does not use regular expressions -// -// POST http://localhost:8080/users -// 1Melissa Raspberry -// -// GET http://localhost:8080/users/1 -// -// PUT http://localhost:8080/users/1 -// 1Melissa -// -// DELETE http://localhost:8080/users/1 -// - -type User struct { - Id, Name string -} - -type UserResource struct { - // normally one would use DAO (data access object) - users map[string]User -} - -func (u UserResource) Register(container *restful.Container) { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well - - ws.Route(ws.GET("/{user-id}").To(u.findUser)) - ws.Route(ws.POST("").To(u.updateUser)) - ws.Route(ws.PUT("/{user-id}").To(u.createUser)) - ws.Route(ws.DELETE("/{user-id}").To(u.removeUser)) - - container.Add(ws) -} - -// GET http://localhost:8080/users/1 -// -func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - usr := u.users[id] - if len(usr.Id) == 0 { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusNotFound, "User could not be found.") - } else { - response.WriteEntity(usr) - } -} - -// POST http://localhost:8080/users -// 1Melissa Raspberry -// -func (u *UserResource) updateUser(request *restful.Request, response *restful.Response) { - usr := new(User) - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.Id] = *usr - response.WriteEntity(usr) - } else { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusInternalServerError, err.Error()) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa -// -func (u *UserResource) createUser(request *restful.Request, response *restful.Response) { - usr := User{Id: request.PathParameter("user-id")} - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.Id] = usr - response.WriteHeader(http.StatusCreated) - response.WriteEntity(usr) - } else { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusInternalServerError, err.Error()) - } -} - -// DELETE http://localhost:8080/users/1 -// -func (u *UserResource) removeUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - delete(u.users, id) -} - -func main() { - wsContainer := restful.NewContainer() - wsContainer.Router(restful.CurlyRouter{}) - u := UserResource{map[string]User{}} - u.Register(wsContainer) - - log.Printf("start listening on localhost:8080") - server := &http.Server{Addr: ":8080", Handler: wsContainer} - log.Fatal(server.ListenAndServe()) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-encoding-filter.go b/vendor/github.com/emicklei/go-restful/examples/restful-encoding-filter.go deleted file mode 100644 index 6094c490925..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-encoding-filter.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "log" - "net/http" -) - -type User struct { - Id, Name string -} - -type UserList struct { - Users []User -} - -// -// This example shows how to use the CompressingResponseWriter by a Filter -// such that encoding can be enabled per WebService or per Route (instead of per container) -// Using restful.DefaultContainer.EnableContentEncoding(true) will encode all responses served by WebServices in the DefaultContainer. -// -// Set Accept-Encoding to gzip or deflate -// GET http://localhost:8080/users/42 -// and look at the response headers - -func main() { - restful.Add(NewUserService()) - log.Printf("start listening on localhost:8080") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func NewUserService() *restful.WebService { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) - - // install a response encoding filter - ws.Route(ws.GET("/{user-id}").Filter(encodingFilter).To(findUser)) - return ws -} - -// Route Filter (defines FilterFunction) -func encodingFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("[encoding-filter] %s,%s\n", req.Request.Method, req.Request.URL) - // wrap responseWriter into a compressing one - compress, _ := restful.NewCompressingResponseWriter(resp.ResponseWriter, restful.ENCODING_GZIP) - resp.ResponseWriter = compress - defer func() { - compress.Close() - }() - chain.ProcessFilter(req, resp) -} - -// GET http://localhost:8080/users/42 -// -func findUser(request *restful.Request, response *restful.Response) { - log.Printf("findUser") - response.WriteEntity(User{"42", "Gandalf"}) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-filters.go b/vendor/github.com/emicklei/go-restful/examples/restful-filters.go deleted file mode 100644 index 47e1146a09e..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-filters.go +++ /dev/null @@ -1,114 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "log" - "net/http" - "time" -) - -type User struct { - Id, Name string -} - -type UserList struct { - Users []User -} - -// This example show how to create and use the three different Filters (Container,WebService and Route) -// When applied to the restful.DefaultContainer, we refer to them as a global filter. -// -// GET http://locahost:8080/users/42 -// and see the logging per filter (try repeating this request) - -func main() { - // install a global (=DefaultContainer) filter (processed before any webservice in the DefaultContainer) - restful.Filter(globalLogging) - - restful.Add(NewUserService()) - log.Printf("start listening on localhost:8080") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func NewUserService() *restful.WebService { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) - - // install a webservice filter (processed before any route) - ws.Filter(webserviceLogging).Filter(measureTime) - - // install a counter filter - ws.Route(ws.GET("").Filter(NewCountFilter().routeCounter).To(getAllUsers)) - - // install 2 chained route filters (processed before calling findUser) - ws.Route(ws.GET("/{user-id}").Filter(routeLogging).Filter(NewCountFilter().routeCounter).To(findUser)) - return ws -} - -// Global Filter -func globalLogging(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("[global-filter (logger)] %s,%s\n", req.Request.Method, req.Request.URL) - chain.ProcessFilter(req, resp) -} - -// WebService Filter -func webserviceLogging(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("[webservice-filter (logger)] %s,%s\n", req.Request.Method, req.Request.URL) - chain.ProcessFilter(req, resp) -} - -// WebService (post-process) Filter (as a struct that defines a FilterFunction) -func measureTime(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - now := time.Now() - chain.ProcessFilter(req, resp) - log.Printf("[webservice-filter (timer)] %v\n", time.Now().Sub(now)) -} - -// Route Filter (defines FilterFunction) -func routeLogging(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("[route-filter (logger)] %s,%s\n", req.Request.Method, req.Request.URL) - chain.ProcessFilter(req, resp) -} - -// Route Filter (as a struct that defines a FilterFunction) -// CountFilter implements a FilterFunction for counting requests. -type CountFilter struct { - count int - counter chan int // for go-routine safe count increments -} - -// NewCountFilter creates and initializes a new CountFilter. -func NewCountFilter() *CountFilter { - c := new(CountFilter) - c.counter = make(chan int) - go func() { - for { - c.count += <-c.counter - } - }() - return c -} - -// routeCounter increments the count of the filter (through a channel) -func (c *CountFilter) routeCounter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - c.counter <- 1 - log.Printf("[route-filter (counter)] count:%d", c.count) - chain.ProcessFilter(req, resp) -} - -// GET http://localhost:8080/users -// -func getAllUsers(request *restful.Request, response *restful.Response) { - log.Printf("getAllUsers") - response.WriteEntity(UserList{[]User{User{"42", "Gandalf"}, User{"3.14", "Pi"}}}) -} - -// GET http://localhost:8080/users/42 -// -func findUser(request *restful.Request, response *restful.Response) { - log.Printf("findUser") - response.WriteEntity(User{"42", "Gandalf"}) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-form-handling.go b/vendor/github.com/emicklei/go-restful/examples/restful-form-handling.go deleted file mode 100644 index a83db4492a4..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-form-handling.go +++ /dev/null @@ -1,62 +0,0 @@ -package main - -import ( - "fmt" - "github.com/emicklei/go-restful" - "github.com/gorilla/schema" - "io" - "net/http" -) - -// This example shows how to handle a POST of a HTML form that uses the standard x-www-form-urlencoded content-type. -// It uses the gorilla web tool kit schema package to decode the form data into a struct. -// -// GET http://localhost:8080/profiles -// - -type Profile struct { - Name string - Age int -} - -var decoder *schema.Decoder - -func main() { - decoder = schema.NewDecoder() - ws := new(restful.WebService) - ws.Route(ws.POST("/profiles").Consumes("application/x-www-form-urlencoded").To(postAdddress)) - ws.Route(ws.GET("/profiles").To(addresssForm)) - restful.Add(ws) - http.ListenAndServe(":8080", nil) -} - -func postAdddress(req *restful.Request, resp *restful.Response) { - err := req.Request.ParseForm() - if err != nil { - resp.WriteErrorString(http.StatusBadRequest, err.Error()) - return - } - p := new(Profile) - err = decoder.Decode(p, req.Request.PostForm) - if err != nil { - resp.WriteErrorString(http.StatusBadRequest, err.Error()) - return - } - io.WriteString(resp.ResponseWriter, fmt.Sprintf("Name=%s, Age=%d", p.Name, p.Age)) -} - -func addresssForm(req *restful.Request, resp *restful.Response) { - io.WriteString(resp.ResponseWriter, - ` - -

Enter Profile

-
- - - - - -
- - `) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go b/vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go deleted file mode 100644 index a21c2a69c13..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-hello-world.go +++ /dev/null @@ -1,22 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "net/http" -) - -// This example shows the minimal code needed to get a restful.WebService working. -// -// GET http://localhost:8080/hello - -func main() { - ws := new(restful.WebService) - ws.Route(ws.GET("/hello").To(hello)) - restful.Add(ws) - http.ListenAndServe(":8080", nil) -} - -func hello(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "world") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-html-template.go b/vendor/github.com/emicklei/go-restful/examples/restful-html-template.go deleted file mode 100644 index de51c5919f1..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-html-template.go +++ /dev/null @@ -1,35 +0,0 @@ -package main - -import ( - "log" - "net/http" - "text/template" - - "github.com/emicklei/go-restful" -) - -// This example shows how to serve a HTML page using the standard Go template engine. -// -// GET http://localhost:8080/ - -func main() { - ws := new(restful.WebService) - ws.Route(ws.GET("/").To(home)) - restful.Add(ws) - print("open browser on http://localhost:8080/\n") - http.ListenAndServe(":8080", nil) -} - -type Message struct { - Text string -} - -func home(req *restful.Request, resp *restful.Response) { - p := &Message{"restful-html-template demo"} - // you might want to cache compiled templates - t, err := template.ParseFiles("home.html") - if err != nil { - log.Fatalf("Template gave: %s", err) - } - t.Execute(resp.ResponseWriter, p) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-multi-containers.go b/vendor/github.com/emicklei/go-restful/examples/restful-multi-containers.go deleted file mode 100644 index 3f1650b36f5..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-multi-containers.go +++ /dev/null @@ -1,43 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" -) - -// This example shows how to have a program with 2 WebServices containers -// each having a http server listening on its own port. -// -// The first "hello" is added to the restful.DefaultContainer (and uses DefaultServeMux) -// For the second "hello", a new container and ServeMux is created -// and requires a new http.Server with the container being the Handler. -// This first server is spawn in its own go-routine such that the program proceeds to create the second. -// -// GET http://localhost:8080/hello -// GET http://localhost:8081/hello - -func main() { - ws := new(restful.WebService) - ws.Route(ws.GET("/hello").To(hello)) - restful.Add(ws) - go func() { - http.ListenAndServe(":8080", nil) - }() - - container2 := restful.NewContainer() - ws2 := new(restful.WebService) - ws2.Route(ws2.GET("/hello").To(hello2)) - container2.Add(ws2) - server := &http.Server{Addr: ":8081", Handler: container2} - log.Fatal(server.ListenAndServe()) -} - -func hello(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "default world") -} - -func hello2(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "second world") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-no-cache-filter.go b/vendor/github.com/emicklei/go-restful/examples/restful-no-cache-filter.go deleted file mode 100644 index 04fae8dce59..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-no-cache-filter.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "io" - "net/http" - - "github.com/emicklei/go-restful" -) - -func NoBrowserCacheFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - resp.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") // HTTP 1.1. - resp.Header().Set("Pragma", "no-cache") // HTTP 1.0. - resp.Header().Set("Expires", "0") // Proxies. - chain.ProcessFilter(req, resp) -} - -// This example shows how to use a WebService filter that passed the Http headers to disable browser cacheing. -// -// GET http://localhost:8080/hello - -func main() { - ws := new(restful.WebService) - ws.Filter(NoBrowserCacheFilter) - ws.Route(ws.GET("/hello").To(hello)) - restful.Add(ws) - http.ListenAndServe(":8080", nil) -} - -func hello(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "world") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-options-filter.go b/vendor/github.com/emicklei/go-restful/examples/restful-options-filter.go deleted file mode 100644 index 73dc3cfe5a0..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-options-filter.go +++ /dev/null @@ -1,51 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" -) - -// This example shows how to use the OPTIONSFilter on a Container -// -// OPTIONS http://localhost:8080/users -// -// OPTIONS http://localhost:8080/users/1 - -type UserResource struct{} - -func (u UserResource) RegisterTo(container *restful.Container) { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes("*/*"). - Produces("*/*") - - ws.Route(ws.GET("/{user-id}").To(u.nop)) - ws.Route(ws.POST("").To(u.nop)) - ws.Route(ws.PUT("/{user-id}").To(u.nop)) - ws.Route(ws.DELETE("/{user-id}").To(u.nop)) - - container.Add(ws) -} - -func (u UserResource) nop(request *restful.Request, response *restful.Response) { - io.WriteString(response.ResponseWriter, "this would be a normal response") -} - -func main() { - wsContainer := restful.NewContainer() - u := UserResource{} - u.RegisterTo(wsContainer) - - // Add container filter to respond to OPTIONS - wsContainer.Filter(wsContainer.OPTIONSFilter) - - // For use on the default container, you can write - // restful.Filter(restful.OPTIONSFilter()) - - log.Printf("start listening on localhost:8080") - server := &http.Server{Addr: ":8080", Handler: wsContainer} - log.Fatal(server.ListenAndServe()) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go b/vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go deleted file mode 100644 index 8488a232cb8..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-path-tail.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "io" - "net/http" - . "github.com/emicklei/go-restful" -) - -// This example shows how to a Route that matches the "tail" of a path. -// Requires the use of a CurlyRouter and the star "*" path parameter pattern. -// -// GET http://localhost:8080/basepath/some/other/location/test.xml - -func main() { - DefaultContainer.Router(CurlyRouter{}) - ws := new(WebService) - ws.Route(ws.GET("/basepath/{resource:*}").To(staticFromPathParam)) - Add(ws) - - println("[go-restful] serve path tails from http://localhost:8080/basepath") - http.ListenAndServe(":8080", nil) -} - -func staticFromPathParam(req *Request, resp *Response) { - io.WriteString(resp, "Tail="+req.PathParameter("resource")) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-pre-post-filters.go b/vendor/github.com/emicklei/go-restful/examples/restful-pre-post-filters.go deleted file mode 100644 index 0b55f14930d..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-pre-post-filters.go +++ /dev/null @@ -1,98 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "io" - "log" - "net/http" -) - -// This example shows how the different types of filters are called in the request-response flow. -// The call chain is logged on the console when sending an http request. -// -// GET http://localhost:8080/1 -// GET http://localhost:8080/2 - -var indentLevel int - -func container_filter_A(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - log.Printf("url path:%v\n", req.Request.URL) - trace("container_filter_A: before", 1) - chain.ProcessFilter(req, resp) - trace("container_filter_A: after", -1) -} - -func container_filter_B(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("container_filter_B: before", 1) - chain.ProcessFilter(req, resp) - trace("container_filter_B: after", -1) -} - -func service_filter_A(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("service_filter_A: before", 1) - chain.ProcessFilter(req, resp) - trace("service_filter_A: after", -1) -} - -func service_filter_B(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("service_filter_B: before", 1) - chain.ProcessFilter(req, resp) - trace("service_filter_B: after", -1) -} - -func route_filter_A(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("route_filter_A: before", 1) - chain.ProcessFilter(req, resp) - trace("route_filter_A: after", -1) -} - -func route_filter_B(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { - trace("route_filter_B: before", 1) - chain.ProcessFilter(req, resp) - trace("route_filter_B: after", -1) -} - -func trace(what string, delta int) { - indented := what - if delta < 0 { - indentLevel += delta - } - for t := 0; t < indentLevel; t++ { - indented = "." + indented - } - log.Printf("%s", indented) - if delta > 0 { - indentLevel += delta - } -} - -func main() { - restful.Filter(container_filter_A) - restful.Filter(container_filter_B) - - ws1 := new(restful.WebService) - ws1.Path("/1") - ws1.Filter(service_filter_A) - ws1.Filter(service_filter_B) - ws1.Route(ws1.GET("").To(doit1).Filter(route_filter_A).Filter(route_filter_B)) - - ws2 := new(restful.WebService) - ws2.Path("/2") - ws2.Filter(service_filter_A) - ws2.Filter(service_filter_B) - ws2.Route(ws2.GET("").To(doit2).Filter(route_filter_A).Filter(route_filter_B)) - - restful.Add(ws1) - restful.Add(ws2) - - log.Print("go-restful example listing on http://localhost:8080/1 and http://localhost:8080/2") - log.Fatal(http.ListenAndServe(":8080", nil)) -} - -func doit1(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "nothing to see in 1") -} - -func doit2(req *restful.Request, resp *restful.Response) { - io.WriteString(resp, "nothing to see in 2") -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-resource-functions.go b/vendor/github.com/emicklei/go-restful/examples/restful-resource-functions.go deleted file mode 100644 index fb1012a028b..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-resource-functions.go +++ /dev/null @@ -1,63 +0,0 @@ -package main - -import ( - "github.com/emicklei/go-restful" - "log" - "net/http" -) - -// This example shows how to use methods as RouteFunctions for WebServices. -// The ProductResource has a Register() method that creates and initializes -// a WebService to expose its methods as REST operations. -// The WebService is added to the restful.DefaultContainer. -// A ProductResource is typically created using some data access object. -// -// GET http://localhost:8080/products/1 -// POST http://localhost:8080/products -// 1The First - -type Product struct { - Id, Title string -} - -type ProductResource struct { - // typically reference a DAO (data-access-object) -} - -func (p ProductResource) getOne(req *restful.Request, resp *restful.Response) { - id := req.PathParameter("id") - log.Println("getting product with id:" + id) - resp.WriteEntity(Product{Id: id, Title: "test"}) -} - -func (p ProductResource) postOne(req *restful.Request, resp *restful.Response) { - updatedProduct := new(Product) - err := req.ReadEntity(updatedProduct) - if err != nil { // bad request - resp.WriteErrorString(http.StatusBadRequest, err.Error()) - return - } - log.Println("updating product with id:" + updatedProduct.Id) -} - -func (p ProductResource) Register() { - ws := new(restful.WebService) - ws.Path("/products") - ws.Consumes(restful.MIME_XML) - ws.Produces(restful.MIME_XML) - - ws.Route(ws.GET("/{id}").To(p.getOne). - Doc("get the product by its id"). - Param(ws.PathParameter("id", "identifier of the product").DataType("string"))) - - ws.Route(ws.POST("").To(p.postOne). - Doc("update or create a product"). - Param(ws.BodyParameter("Product", "a Product (XML)").DataType("main.Product"))) - - restful.Add(ws) -} - -func main() { - ProductResource{}.Register() - http.ListenAndServe(":8080", nil) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-serve-static.go b/vendor/github.com/emicklei/go-restful/examples/restful-serve-static.go deleted file mode 100644 index 8cb7848c1d0..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-serve-static.go +++ /dev/null @@ -1,47 +0,0 @@ -package main - -import ( - "fmt" - "net/http" - "path" - - "github.com/emicklei/go-restful" -) - -// This example shows how to define methods that serve static files -// It uses the standard http.ServeFile method -// -// GET http://localhost:8080/static/test.xml -// GET http://localhost:8080/static/ -// -// GET http://localhost:8080/static?resource=subdir/test.xml - -var rootdir = "/tmp" - -func main() { - restful.DefaultContainer.Router(restful.CurlyRouter{}) - - ws := new(restful.WebService) - ws.Route(ws.GET("/static/{subpath:*}").To(staticFromPathParam)) - ws.Route(ws.GET("/static").To(staticFromQueryParam)) - restful.Add(ws) - - println("[go-restful] serving files on http://localhost:8080/static from local /tmp") - http.ListenAndServe(":8080", nil) -} - -func staticFromPathParam(req *restful.Request, resp *restful.Response) { - actual := path.Join(rootdir, req.PathParameter("subpath")) - fmt.Printf("serving %s ... (from %s)\n", actual, req.PathParameter("subpath")) - http.ServeFile( - resp.ResponseWriter, - req.Request, - actual) -} - -func staticFromQueryParam(req *restful.Request, resp *restful.Response) { - http.ServeFile( - resp.ResponseWriter, - req.Request, - path.Join(rootdir, req.QueryParameter("resource"))) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-swagger.go b/vendor/github.com/emicklei/go-restful/examples/restful-swagger.go deleted file mode 100644 index 7746b5b0705..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-swagger.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "log" - "net/http" - - "github.com/emicklei/go-restful" - "github.com/emicklei/go-restful/swagger" -) - -type Book struct { - Title string - Author string -} - -func main() { - ws := new(restful.WebService) - ws.Path("/books") - ws.Consumes(restful.MIME_JSON, restful.MIME_XML) - ws.Produces(restful.MIME_JSON, restful.MIME_XML) - restful.Add(ws) - - ws.Route(ws.GET("/{medium}").To(noop). - Doc("Search all books"). - Param(ws.PathParameter("medium", "digital or paperback").DataType("string")). - Param(ws.QueryParameter("language", "en,nl,de").DataType("string")). - Param(ws.HeaderParameter("If-Modified-Since", "last known timestamp").DataType("datetime")). - Do(returns200, returns500)) - - ws.Route(ws.PUT("/{medium}").To(noop). - Doc("Add a new book"). - Param(ws.PathParameter("medium", "digital or paperback").DataType("string")). - Reads(Book{})) - - // You can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open http://localhost:8080/apidocs and enter http://localhost:8080/apidocs.json in the api input field. - config := swagger.Config{ - WebServices: restful.DefaultContainer.RegisteredWebServices(), // you control what services are visible - WebServicesUrl: "http://localhost:8080", - ApiPath: "/apidocs.json", - - // Optionally, specifiy where the UI is located - SwaggerPath: "/apidocs/", - SwaggerFilePath: "/Users/emicklei/xProjects/swagger-ui/dist"} - swagger.RegisterSwaggerService(config, restful.DefaultContainer) - - log.Printf("start listening on localhost:8080") - server := &http.Server{Addr: ":8080", Handler: restful.DefaultContainer} - log.Fatal(server.ListenAndServe()) -} - -func noop(req *restful.Request, resp *restful.Response) {} - -func returns200(b *restful.RouteBuilder) { - b.Returns(http.StatusOK, "OK", Book{}) -} - -func returns500(b *restful.RouteBuilder) { - b.Returns(http.StatusInternalServerError, "Bummer, something went wrong", nil) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-user-resource.go b/vendor/github.com/emicklei/go-restful/examples/restful-user-resource.go deleted file mode 100644 index 6b860dc2064..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-user-resource.go +++ /dev/null @@ -1,152 +0,0 @@ -package main - -import ( - "log" - "net/http" - "strconv" - - "github.com/emicklei/go-restful" - "github.com/emicklei/go-restful/swagger" -) - -// This example show a complete (GET,PUT,POST,DELETE) conventional example of -// a REST Resource including documentation to be served by e.g. a Swagger UI -// It is recommended to create a Resource struct (UserResource) that can encapsulate -// an object that provide domain access (a DAO) -// It has a Register method including the complete Route mapping to methods together -// with all the appropriate documentation -// -// POST http://localhost:8080/users -// 1Melissa Raspberry -// -// GET http://localhost:8080/users/1 -// -// PUT http://localhost:8080/users/1 -// 1Melissa -// -// DELETE http://localhost:8080/users/1 -// - -type User struct { - Id, Name string -} - -type UserResource struct { - // normally one would use DAO (data access object) - users map[string]User -} - -func (u UserResource) Register(container *restful.Container) { - ws := new(restful.WebService) - ws. - Path("/users"). - Doc("Manage Users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well - - ws.Route(ws.GET("/{user-id}").To(u.findUser). - // docs - Doc("get a user"). - Operation("findUser"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Writes(User{})) // on the response - - ws.Route(ws.PUT("/{user-id}").To(u.updateUser). - // docs - Doc("update a user"). - Operation("updateUser"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - ReturnsError(409, "duplicate user-id", nil). - Reads(User{})) // from the request - - ws.Route(ws.POST("").To(u.createUser). - // docs - Doc("create a user"). - Operation("createUser"). - Reads(User{})) // from the request - - ws.Route(ws.DELETE("/{user-id}").To(u.removeUser). - // docs - Doc("delete a user"). - Operation("removeUser"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string"))) - - container.Add(ws) -} - -// GET http://localhost:8080/users/1 -// -func (u UserResource) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - usr := u.users[id] - if len(usr.Id) == 0 { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusNotFound, "404: User could not be found.") - return - } - response.WriteEntity(usr) -} - -// POST http://localhost:8080/users -// Melissa -// -func (u *UserResource) createUser(request *restful.Request, response *restful.Response) { - usr := new(User) - err := request.ReadEntity(usr) - if err != nil { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusInternalServerError, err.Error()) - return - } - usr.Id = strconv.Itoa(len(u.users) + 1) // simple id generation - u.users[usr.Id] = *usr - response.WriteHeaderAndEntity(http.StatusCreated, usr) -} - -// PUT http://localhost:8080/users/1 -// 1Melissa Raspberry -// -func (u *UserResource) updateUser(request *restful.Request, response *restful.Response) { - usr := new(User) - err := request.ReadEntity(&usr) - if err != nil { - response.AddHeader("Content-Type", "text/plain") - response.WriteErrorString(http.StatusInternalServerError, err.Error()) - return - } - u.users[usr.Id] = *usr - response.WriteEntity(usr) -} - -// DELETE http://localhost:8080/users/1 -// -func (u *UserResource) removeUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - delete(u.users, id) -} - -func main() { - // to see what happens in the package, uncomment the following - //restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile)) - - wsContainer := restful.NewContainer() - u := UserResource{map[string]User{}} - u.Register(wsContainer) - - // Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open http://localhost:8080/apidocs and enter http://localhost:8080/apidocs.json in the api input field. - config := swagger.Config{ - WebServices: wsContainer.RegisteredWebServices(), // you control what services are visible - WebServicesUrl: "http://localhost:8080", - ApiPath: "/apidocs.json", - - // Optionally, specifiy where the UI is located - SwaggerPath: "/apidocs/", - SwaggerFilePath: "/Users/emicklei/xProjects/swagger-ui/dist"} - swagger.RegisterSwaggerService(config, wsContainer) - - log.Printf("start listening on localhost:8080") - server := &http.Server{Addr: ":8080", Handler: wsContainer} - log.Fatal(server.ListenAndServe()) -} diff --git a/vendor/github.com/emicklei/go-restful/examples/restful-user-service.go b/vendor/github.com/emicklei/go-restful/examples/restful-user-service.go deleted file mode 100644 index 77c678ce489..00000000000 --- a/vendor/github.com/emicklei/go-restful/examples/restful-user-service.go +++ /dev/null @@ -1,137 +0,0 @@ -package main - -import ( - "log" - "net/http" - - "github.com/emicklei/go-restful" - "github.com/emicklei/go-restful/swagger" -) - -// This example is functionally the same as the example in restful-user-resource.go -// with the only difference that is served using the restful.DefaultContainer - -type User struct { - Id, Name string -} - -type UserService struct { - // normally one would use DAO (data access object) - users map[string]User -} - -func (u UserService) Register() { - ws := new(restful.WebService) - ws. - Path("/users"). - Consumes(restful.MIME_XML, restful.MIME_JSON). - Produces(restful.MIME_JSON, restful.MIME_XML) // you can specify this per route as well - - ws.Route(ws.GET("/").To(u.findAllUsers). - // docs - Doc("get all users"). - Operation("findAllUsers"). - Returns(200, "OK", []User{})) - - ws.Route(ws.GET("/{user-id}").To(u.findUser). - // docs - Doc("get a user"). - Operation("findUser"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Writes(User{})) // on the response - - ws.Route(ws.PUT("/{user-id}").To(u.updateUser). - // docs - Doc("update a user"). - Operation("updateUser"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")). - Reads(User{})) // from the request - - ws.Route(ws.PUT("").To(u.createUser). - // docs - Doc("create a user"). - Operation("createUser"). - Reads(User{})) // from the request - - ws.Route(ws.DELETE("/{user-id}").To(u.removeUser). - // docs - Doc("delete a user"). - Operation("removeUser"). - Param(ws.PathParameter("user-id", "identifier of the user").DataType("string"))) - - restful.Add(ws) -} - -// GET http://localhost:8080/users -// -func (u UserService) findAllUsers(request *restful.Request, response *restful.Response) { - response.WriteEntity(u.users) -} - -// GET http://localhost:8080/users/1 -// -func (u UserService) findUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - usr := u.users[id] - if len(usr.Id) == 0 { - response.WriteErrorString(http.StatusNotFound, "User could not be found.") - } else { - response.WriteEntity(usr) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa Raspberry -// -func (u *UserService) updateUser(request *restful.Request, response *restful.Response) { - usr := new(User) - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.Id] = *usr - response.WriteEntity(usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// PUT http://localhost:8080/users/1 -// 1Melissa -// -func (u *UserService) createUser(request *restful.Request, response *restful.Response) { - usr := User{Id: request.PathParameter("user-id")} - err := request.ReadEntity(&usr) - if err == nil { - u.users[usr.Id] = usr - response.WriteHeaderAndEntity(http.StatusCreated, usr) - } else { - response.WriteError(http.StatusInternalServerError, err) - } -} - -// DELETE http://localhost:8080/users/1 -// -func (u *UserService) removeUser(request *restful.Request, response *restful.Response) { - id := request.PathParameter("user-id") - delete(u.users, id) -} - -func main() { - u := UserService{map[string]User{}} - u.Register() - - // Optionally, you can install the Swagger Service which provides a nice Web UI on your REST API - // You need to download the Swagger HTML5 assets and change the FilePath location in the config below. - // Open http://localhost:8080/apidocs and enter http://localhost:8080/apidocs.json in the api input field. - config := swagger.Config{ - WebServices: restful.RegisteredWebServices(), // you control what services are visible - WebServicesUrl: "http://localhost:8080", - ApiPath: "/apidocs.json", - - // Optionally, specifiy where the UI is located - SwaggerPath: "/apidocs/", - SwaggerFilePath: "/Users/emicklei/Projects/swagger-ui/dist"} - swagger.InstallSwaggerService(config) - - log.Printf("start listening on localhost:8080") - log.Fatal(http.ListenAndServe(":8080", nil)) -} diff --git a/vendor/github.com/emicklei/go-restful/swagger/test_package/struct.go b/vendor/github.com/emicklei/go-restful/swagger/test_package/struct.go deleted file mode 100644 index b9a6f930870..00000000000 --- a/vendor/github.com/emicklei/go-restful/swagger/test_package/struct.go +++ /dev/null @@ -1,5 +0,0 @@ -package test_package - -type TestStruct struct { - TestField string -} 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 0e5fb872800..00000000000 --- 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 c60a31b053b..00000000000 --- 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 81cb128b19c..00000000000 --- 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 73c7400311e..00000000000 --- 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 0e5fb872800..00000000000 --- 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 b987c9e5d10..00000000000 --- 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 49798cb5cf5..00000000000 --- 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 cb03ddfe533..00000000000 --- 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 06728dd545e..00000000000 --- 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 913432c1c0d..00000000000 --- 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 027e8c20e61..00000000000 --- 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 0948dcfa8cc..00000000000 --- 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 e69de29bb2d..00000000000 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 8e38bba13c6..00000000000 --- 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 5e7244b24ff..00000000000 --- 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 e4b066e3b6d..00000000000 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 32c9ce64704..00000000000 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 e69de29bb2d..00000000000 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 a9346bcf45a..00000000000 --- 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 89cc445e1ba..00000000000 --- 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 c897e5da550..00000000000 --- 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 c8b086dae3d..00000000000 --- a/vendor/github.com/fsouza/go-dockerclient/testing/server.go +++ /dev/null @@ -1,1330 +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)) - s.mux.Path("/info").Methods("GET").HandlerFunc(s.handlerWrapper(s.infoDocker)) -} - -// 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 - } - config := new(docker.Config) - runConfig := r.URL.Query().Get("run") - if runConfig != "" { - 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(), - Config: &docker.Config{}, - } - 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) -} - -func (s *DockerServer) infoDocker(w http.ResponseWriter, r *http.Request) { - s.cMut.RLock() - defer s.cMut.RUnlock() - s.iMut.RLock() - defer s.iMut.RUnlock() - var running, stopped, paused int - for _, c := range s.containers { - if c.State.Running { - running++ - } else { - stopped++ - } - if c.State.Paused { - paused++ - } - } - envs := map[string]interface{}{ - "ID": "AAAA:XXXX:0000:BBBB:AAAA:XXXX:0000:BBBB:AAAA:XXXX:0000:BBBB", - "Containers": len(s.containers), - "ContainersRunning": running, - "ContainersPaused": paused, - "ContainersStopped": stopped, - "Images": len(s.images), - "Driver": "aufs", - "DriverStatus": [][]string{}, - "SystemStatus": nil, - "Plugins": map[string]interface{}{ - "Volume": []string{ - "local", - }, - "Network": []string{ - "bridge", - "null", - "host", - }, - "Authorization": nil, - }, - "MemoryLimit": true, - "SwapLimit": false, - "CpuCfsPeriod": true, - "CpuCfsQuota": true, - "CPUShares": true, - "CPUSet": true, - "IPv4Forwarding": true, - "BridgeNfIptables": true, - "BridgeNfIp6tables": true, - "Debug": false, - "NFd": 79, - "OomKillDisable": true, - "NGoroutines": 101, - "SystemTime": "2016-02-25T18:13:10.25870078Z", - "ExecutionDriver": "native-0.2", - "LoggingDriver": "json-file", - "NEventsListener": 0, - "KernelVersion": "3.13.0-77-generic", - "OperatingSystem": "Ubuntu 14.04.3 LTS", - "OSType": "linux", - "Architecture": "x86_64", - "IndexServerAddress": "https://index.docker.io/v1/", - "RegistryConfig": map[string]interface{}{ - "InsecureRegistryCIDRs": []string{}, - "IndexConfigs": map[string]interface{}{}, - "Mirrors": nil, - }, - "InitSha1": "e2042dbb0fcf49bb9da199186d9a5063cda92a01", - "InitPath": "/usr/lib/docker/dockerinit", - "NCPU": 1, - "MemTotal": 2099204096, - "DockerRootDir": "/var/lib/docker", - "HttpProxy": "", - "HttpsProxy": "", - "NoProxy": "", - "Name": "vagrant-ubuntu-trusty-64", - "Labels": nil, - "ExperimentalBuild": false, - "ServerVersion": "1.10.1", - "ClusterStore": "", - "ClusterAdvertise": "", - } - w.WriteHeader(http.StatusOK) - json.NewEncoder(w).Encode(envs) -} diff --git a/vendor/github.com/fsouza/go-dockerclient/travis-scripts/install.bash b/vendor/github.com/fsouza/go-dockerclient/travis-scripts/install.bash deleted file mode 100644 index 9d1708fa994..00000000000 --- a/vendor/github.com/fsouza/go-dockerclient/travis-scripts/install.bash +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -x - -# Copyright 2016 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. - -if [[ $TRAVIS_OS_NAME == "linux" ]]; then - sudo stop docker || true - sudo rm -rf /var/lib/docker - sudo rm -f `which docker` - - set -e - sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D - echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list - sudo apt-get update - sudo apt-get install docker-engine=${DOCKER_VERSION}-0~$(lsb_release -cs) -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -fi diff --git a/vendor/github.com/fsouza/go-dockerclient/travis-scripts/run-tests.bash b/vendor/github.com/fsouza/go-dockerclient/travis-scripts/run-tests.bash deleted file mode 100644 index 8e82d8e7ea8..00000000000 --- a/vendor/github.com/fsouza/go-dockerclient/travis-scripts/run-tests.bash +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -ex - -# Copyright 2016 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. - -if ! [[ $TRAVIS_GO_VERSION =~ ^1\.[34] ]]; then - make lint vet -fi - -make fmtcheck gotest - -if [[ $TRAVIS_OS_NAME == "linux" ]]; then - DOCKER_HOST=tcp://127.0.0.1:2375 make integration -fi diff --git a/vendor/github.com/garyburd/redigo/internal/redistest/testdb.go b/vendor/github.com/garyburd/redigo/internal/redistest/testdb.go deleted file mode 100644 index 5f955c42448..00000000000 --- a/vendor/github.com/garyburd/redigo/internal/redistest/testdb.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2014 Gary Burd -// -// 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 redistest contains utilities for writing Redigo tests. -package redistest - -import ( - "errors" - "time" - - "github.com/garyburd/redigo/redis" -) - -type testConn struct { - redis.Conn -} - -func (t testConn) Close() error { - _, err := t.Conn.Do("SELECT", "9") - if err != nil { - return nil - } - _, err = t.Conn.Do("FLUSHDB") - if err != nil { - return err - } - return t.Conn.Close() -} - -// Dial dials the local Redis server and selects database 9. To prevent -// stomping on real data, DialTestDB fails if database 9 contains data. The -// returned connection flushes database 9 on close. -func Dial() (redis.Conn, error) { - c, err := redis.DialTimeout("tcp", ":6379", 0, 1*time.Second, 1*time.Second) - if err != nil { - return nil, err - } - - _, err = c.Do("SELECT", "9") - if err != nil { - return nil, err - } - - n, err := redis.Int(c.Do("DBSIZE")) - if err != nil { - return nil, err - } - - if n != 0 { - return nil, errors.New("database #9 is not empty, test can not continue") - } - - return testConn{c}, nil -} diff --git a/vendor/github.com/godbus/dbus/introspect/call.go b/vendor/github.com/godbus/dbus/introspect/call.go deleted file mode 100644 index 790a23ec240..00000000000 --- a/vendor/github.com/godbus/dbus/introspect/call.go +++ /dev/null @@ -1,27 +0,0 @@ -package introspect - -import ( - "encoding/xml" - "github.com/godbus/dbus" - "strings" -) - -// Call calls org.freedesktop.Introspectable.Introspect on a remote object -// and returns the introspection data. -func Call(o dbus.BusObject) (*Node, error) { - var xmldata string - var node Node - - err := o.Call("org.freedesktop.DBus.Introspectable.Introspect", 0).Store(&xmldata) - if err != nil { - return nil, err - } - err = xml.NewDecoder(strings.NewReader(xmldata)).Decode(&node) - if err != nil { - return nil, err - } - if node.Name == "" { - node.Name = string(o.Path()) - } - return &node, nil -} diff --git a/vendor/github.com/godbus/dbus/introspect/introspect.go b/vendor/github.com/godbus/dbus/introspect/introspect.go deleted file mode 100644 index b06c3f1cf2d..00000000000 --- a/vendor/github.com/godbus/dbus/introspect/introspect.go +++ /dev/null @@ -1,86 +0,0 @@ -// Package introspect provides some utilities for dealing with the DBus -// introspection format. -package introspect - -import "encoding/xml" - -// The introspection data for the org.freedesktop.DBus.Introspectable interface. -var IntrospectData = Interface{ - Name: "org.freedesktop.DBus.Introspectable", - Methods: []Method{ - { - Name: "Introspect", - Args: []Arg{ - {"out", "s", "out"}, - }, - }, - }, -} - -// XML document type declaration of the introspection format version 1.0 -const IntrospectDeclarationString = ` - -` - -// The introspection data for the org.freedesktop.DBus.Introspectable interface, -// as a string. -const IntrospectDataString = ` - - - - - -` - -// Node is the root element of an introspection. -type Node struct { - XMLName xml.Name `xml:"node"` - Name string `xml:"name,attr,omitempty"` - Interfaces []Interface `xml:"interface"` - Children []Node `xml:"node,omitempty"` -} - -// Interface describes a DBus interface that is available on the message bus. -type Interface struct { - Name string `xml:"name,attr"` - Methods []Method `xml:"method"` - Signals []Signal `xml:"signal"` - Properties []Property `xml:"property"` - Annotations []Annotation `xml:"annotation"` -} - -// Method describes a Method on an Interface as retured by an introspection. -type Method struct { - Name string `xml:"name,attr"` - Args []Arg `xml:"arg"` - Annotations []Annotation `xml:"annotation"` -} - -// Signal describes a Signal emitted on an Interface. -type Signal struct { - Name string `xml:"name,attr"` - Args []Arg `xml:"arg"` - Annotations []Annotation `xml:"annotation"` -} - -// Property describes a property of an Interface. -type Property struct { - Name string `xml:"name,attr"` - Type string `xml:"type,attr"` - Access string `xml:"access,attr"` - Annotations []Annotation `xml:"annotation"` -} - -// Arg represents an argument of a method or a signal. -type Arg struct { - Name string `xml:"name,attr,omitempty"` - Type string `xml:"type,attr"` - Direction string `xml:"direction,attr,omitempty"` -} - -// Annotation is an annotation in the introspection format. -type Annotation struct { - Name string `xml:"name,attr"` - Value string `xml:"value,attr"` -} diff --git a/vendor/github.com/godbus/dbus/introspect/introspectable.go b/vendor/github.com/godbus/dbus/introspect/introspectable.go deleted file mode 100644 index 2f16690b99c..00000000000 --- a/vendor/github.com/godbus/dbus/introspect/introspectable.go +++ /dev/null @@ -1,76 +0,0 @@ -package introspect - -import ( - "encoding/xml" - "github.com/godbus/dbus" - "reflect" - "strings" -) - -// Introspectable implements org.freedesktop.Introspectable. -// -// You can create it by converting the XML-formatted introspection data from a -// string to an Introspectable or call NewIntrospectable with a Node. Then, -// export it as org.freedesktop.Introspectable on you object. -type Introspectable string - -// NewIntrospectable returns an Introspectable that returns the introspection -// data that corresponds to the given Node. If n.Interfaces doesn't contain the -// data for org.freedesktop.DBus.Introspectable, it is added automatically. -func NewIntrospectable(n *Node) Introspectable { - found := false - for _, v := range n.Interfaces { - if v.Name == "org.freedesktop.DBus.Introspectable" { - found = true - break - } - } - if !found { - n.Interfaces = append(n.Interfaces, IntrospectData) - } - b, err := xml.Marshal(n) - if err != nil { - panic(err) - } - return Introspectable(strings.TrimSpace(IntrospectDeclarationString) + string(b)) -} - -// Introspect implements org.freedesktop.Introspectable.Introspect. -func (i Introspectable) Introspect() (string, *dbus.Error) { - return string(i), nil -} - -// Methods returns the description of the methods of v. This can be used to -// create a Node which can be passed to NewIntrospectable. -func Methods(v interface{}) []Method { - t := reflect.TypeOf(v) - ms := make([]Method, 0, t.NumMethod()) - for i := 0; i < t.NumMethod(); i++ { - if t.Method(i).PkgPath != "" { - continue - } - mt := t.Method(i).Type - if mt.NumOut() == 0 || - mt.Out(mt.NumOut()-1) != reflect.TypeOf(&dbus.Error{}) { - - continue - } - var m Method - m.Name = t.Method(i).Name - m.Args = make([]Arg, 0, mt.NumIn()+mt.NumOut()-2) - for j := 1; j < mt.NumIn(); j++ { - if mt.In(j) != reflect.TypeOf((*dbus.Sender)(nil)).Elem() && - mt.In(j) != reflect.TypeOf((*dbus.Message)(nil)).Elem() { - arg := Arg{"", dbus.SignatureOfType(mt.In(j)).String(), "in"} - m.Args = append(m.Args, arg) - } - } - for j := 0; j < mt.NumOut()-1; j++ { - arg := Arg{"", dbus.SignatureOfType(mt.Out(j)).String(), "out"} - m.Args = append(m.Args, arg) - } - m.Annotations = make([]Annotation, 0) - ms = append(ms, m) - } - return ms -} diff --git a/vendor/github.com/godbus/dbus/prop/prop.go b/vendor/github.com/godbus/dbus/prop/prop.go deleted file mode 100644 index 834a1fa8932..00000000000 --- a/vendor/github.com/godbus/dbus/prop/prop.go +++ /dev/null @@ -1,264 +0,0 @@ -// Package prop provides the Properties struct which can be used to implement -// org.freedesktop.DBus.Properties. -package prop - -import ( - "github.com/godbus/dbus" - "github.com/godbus/dbus/introspect" - "sync" -) - -// EmitType controls how org.freedesktop.DBus.Properties.PropertiesChanged is -// emitted for a property. If it is EmitTrue, the signal is emitted. If it is -// EmitInvalidates, the signal is also emitted, but the new value of the property -// is not disclosed. -type EmitType byte - -const ( - EmitFalse EmitType = iota - EmitTrue - EmitInvalidates -) - -// ErrIfaceNotFound is the error returned to peers who try to access properties -// on interfaces that aren't found. -var ErrIfaceNotFound = dbus.NewError("org.freedesktop.DBus.Properties.Error.InterfaceNotFound", nil) - -// ErrPropNotFound is the error returned to peers trying to access properties -// that aren't found. -var ErrPropNotFound = dbus.NewError("org.freedesktop.DBus.Properties.Error.PropertyNotFound", nil) - -// ErrReadOnly is the error returned to peers trying to set a read-only -// property. -var ErrReadOnly = dbus.NewError("org.freedesktop.DBus.Properties.Error.ReadOnly", nil) - -// ErrInvalidArg is returned to peers if the type of the property that is being -// changed and the argument don't match. -var ErrInvalidArg = dbus.NewError("org.freedesktop.DBus.Properties.Error.InvalidArg", nil) - -// The introspection data for the org.freedesktop.DBus.Properties interface. -var IntrospectData = introspect.Interface{ - Name: "org.freedesktop.DBus.Properties", - Methods: []introspect.Method{ - { - Name: "Get", - Args: []introspect.Arg{ - {"interface", "s", "in"}, - {"property", "s", "in"}, - {"value", "v", "out"}, - }, - }, - { - Name: "GetAll", - Args: []introspect.Arg{ - {"interface", "s", "in"}, - {"props", "a{sv}", "out"}, - }, - }, - { - Name: "Set", - Args: []introspect.Arg{ - {"interface", "s", "in"}, - {"property", "s", "in"}, - {"value", "v", "in"}, - }, - }, - }, - Signals: []introspect.Signal{ - { - Name: "PropertiesChanged", - Args: []introspect.Arg{ - {"interface", "s", "out"}, - {"changed_properties", "a{sv}", "out"}, - {"invalidates_properties", "as", "out"}, - }, - }, - }, -} - -// The introspection data for the org.freedesktop.DBus.Properties interface, as -// a string. -const IntrospectDataString = ` - - - - - - - - - - - - - - - - - - - - - -` - -// Prop represents a single property. It is used for creating a Properties -// value. -type Prop struct { - // Initial value. Must be a DBus-representable type. - Value interface{} - - // If true, the value can be modified by calls to Set. - Writable bool - - // Controls how org.freedesktop.DBus.Properties.PropertiesChanged is - // emitted if this property changes. - Emit EmitType - - // If not nil, anytime this property is changed by Set, this function is - // called with an appropiate Change as its argument. If the returned error - // is not nil, it is sent back to the caller of Set and the property is not - // changed. - Callback func(*Change) *dbus.Error -} - -// Change represents a change of a property by a call to Set. -type Change struct { - Props *Properties - Iface string - Name string - Value interface{} -} - -// Properties is a set of values that can be made available to the message bus -// using the org.freedesktop.DBus.Properties interface. It is safe for -// concurrent use by multiple goroutines. -type Properties struct { - m map[string]map[string]*Prop - mut sync.RWMutex - conn *dbus.Conn - path dbus.ObjectPath -} - -// New returns a new Properties structure that manages the given properties. -// The key for the first-level map of props is the name of the interface; the -// second-level key is the name of the property. The returned structure will be -// exported as org.freedesktop.DBus.Properties on path. -func New(conn *dbus.Conn, path dbus.ObjectPath, props map[string]map[string]*Prop) *Properties { - p := &Properties{m: props, conn: conn, path: path} - conn.Export(p, path, "org.freedesktop.DBus.Properties") - return p -} - -// Get implements org.freedesktop.DBus.Properties.Get. -func (p *Properties) Get(iface, property string) (dbus.Variant, *dbus.Error) { - p.mut.RLock() - defer p.mut.RUnlock() - m, ok := p.m[iface] - if !ok { - return dbus.Variant{}, ErrIfaceNotFound - } - prop, ok := m[property] - if !ok { - return dbus.Variant{}, ErrPropNotFound - } - return dbus.MakeVariant(prop.Value), nil -} - -// GetAll implements org.freedesktop.DBus.Properties.GetAll. -func (p *Properties) GetAll(iface string) (map[string]dbus.Variant, *dbus.Error) { - p.mut.RLock() - defer p.mut.RUnlock() - m, ok := p.m[iface] - if !ok { - return nil, ErrIfaceNotFound - } - rm := make(map[string]dbus.Variant, len(m)) - for k, v := range m { - rm[k] = dbus.MakeVariant(v.Value) - } - return rm, nil -} - -// GetMust returns the value of the given property and panics if either the -// interface or the property name are invalid. -func (p *Properties) GetMust(iface, property string) interface{} { - p.mut.RLock() - defer p.mut.RUnlock() - return p.m[iface][property].Value -} - -// Introspection returns the introspection data that represents the properties -// of iface. -func (p *Properties) Introspection(iface string) []introspect.Property { - p.mut.RLock() - defer p.mut.RUnlock() - m := p.m[iface] - s := make([]introspect.Property, 0, len(m)) - for k, v := range m { - p := introspect.Property{Name: k, Type: dbus.SignatureOf(v.Value).String()} - if v.Writable { - p.Access = "readwrite" - } else { - p.Access = "read" - } - s = append(s, p) - } - return s -} - -// set sets the given property and emits PropertyChanged if appropiate. p.mut -// must already be locked. -func (p *Properties) set(iface, property string, v interface{}) { - prop := p.m[iface][property] - prop.Value = v - switch prop.Emit { - case EmitFalse: - // do nothing - case EmitInvalidates: - p.conn.Emit(p.path, "org.freedesktop.DBus.Properties.PropertiesChanged", - iface, map[string]dbus.Variant{}, []string{property}) - case EmitTrue: - p.conn.Emit(p.path, "org.freedesktop.DBus.Properties.PropertiesChanged", - iface, map[string]dbus.Variant{property: dbus.MakeVariant(v)}, - []string{}) - default: - panic("invalid value for EmitType") - } -} - -// Set implements org.freedesktop.Properties.Set. -func (p *Properties) Set(iface, property string, newv dbus.Variant) *dbus.Error { - p.mut.Lock() - defer p.mut.Unlock() - m, ok := p.m[iface] - if !ok { - return ErrIfaceNotFound - } - prop, ok := m[property] - if !ok { - return ErrPropNotFound - } - if !prop.Writable { - return ErrReadOnly - } - if newv.Signature() != dbus.SignatureOf(prop.Value) { - return ErrInvalidArg - } - if prop.Callback != nil { - err := prop.Callback(&Change{p, iface, property, newv.Value()}) - if err != nil { - return err - } - } - p.set(iface, property, newv.Value()) - return nil -} - -// SetMust sets the value of the given property and panics if the interface or -// the property name are invalid. -func (p *Properties) SetMust(iface, property string, v interface{}) { - p.mut.Lock() - p.set(iface, property, v) - p.mut.Unlock() -} diff --git a/vendor/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go b/vendor/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go deleted file mode 100644 index 0de701e8890..00000000000 --- a/vendor/github.com/gogo/protobuf/proto/proto3_proto/proto3.pb.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by protoc-gen-gogo. -// 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/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import testdata "github.com/gogo/protobuf/proto/testdata" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -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,proto3" json:"name,omitempty"` - Hilarity Message_Humour `protobuf:"varint,2,opt,name=hilarity,proto3,enum=proto3_proto.Message_Humour" json:"hilarity,omitempty"` - HeightInCm uint32 `protobuf:"varint,3,opt,name=height_in_cm,proto3" 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,proto3" json:"result_count,omitempty"` - TrueScotsman bool `protobuf:"varint,8,opt,name=true_scotsman,proto3" json:"true_scotsman,omitempty"` - Score float32 `protobuf:"fixed32,9,opt,name=score,proto3" 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,proto3" 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,proto3" 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,proto3" 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,proto3" 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.RegisterType((*Message)(nil), "proto3_proto.Message") - proto.RegisterType((*Nested)(nil), "proto3_proto.Nested") - proto.RegisterType((*MessageWithMap)(nil), "proto3_proto.MessageWithMap") - proto.RegisterEnum("proto3_proto.Message_Humour", Message_Humour_name, Message_Humour_value) -} diff --git a/vendor/github.com/gogo/protobuf/proto/proto3_proto/proto3.proto b/vendor/github.com/gogo/protobuf/proto/proto3_proto/proto3.proto deleted file mode 100644 index ca670015a26..00000000000 --- a/vendor/github.com/gogo/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"; - -package proto3_proto; - -import "github.com/gogo/protobuf/proto/testdata/test.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/gogo/protobuf/vanity/test/Makefile b/vendor/github.com/gogo/protobuf/vanity/test/Makefile deleted file mode 100644 index 846b74fd91e..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -regenerate: - go install github.com/gogo/protobuf/protoc-gen-gogofast - protoc --gogofast_out=./fast/ vanity.proto - protoc --proto_path=../../:../../../../../:../../protobuf/:. --gogofast_out=./fast/ gogovanity.proto - protoc-min-version -version="3.0.0" --proto_path=../../:../../../../../:../../protobuf/:. --gogofast_out=./fast/ proto3.proto - go install github.com/gogo/protobuf/protoc-gen-gogofaster - protoc --gogofaster_out=./faster/ vanity.proto - protoc --proto_path=../../:../../../../../:../../protobuf/:. --gogofaster_out=./faster/ gogovanity.proto - protoc-min-version -version="3.0.0" --proto_path=../../:../../../../../:../../protobuf/:. --gogofaster_out=./faster/ proto3.proto - go install github.com/gogo/protobuf/protoc-gen-gogoslick - protoc --gogoslick_out=./slick/ vanity.proto - protoc --proto_path=../../:../../../../../:../../protobuf/:. --gogoslick_out=./slick/ gogovanity.proto - protoc-min-version -version="3.0.0" --proto_path=../../:../../../../../:../../protobuf/:. --gogoslick_out=./slick/ proto3.proto - -test: - go install github.com/gogo/protobuf/protoc-gen-gofast - protoc --gofast_out=./gofast/ vanity.proto - go test ./... diff --git a/vendor/github.com/gogo/protobuf/vanity/test/doc.go b/vendor/github.com/gogo/protobuf/vanity/test/doc.go deleted file mode 100644 index 56e54040790..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/doc.go +++ /dev/null @@ -1 +0,0 @@ -package test diff --git a/vendor/github.com/gogo/protobuf/vanity/test/fast/gogovanity.pb.go b/vendor/github.com/gogo/protobuf/vanity/test/fast/gogovanity.pb.go deleted file mode 100644 index 714f68bbdfc..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/fast/gogovanity.pb.go +++ /dev/null @@ -1,385 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: gogovanity.proto -// DO NOT EDIT! - -/* - Package vanity is a generated protocol buffer package. - - It is generated from these files: - gogovanity.proto - - It has these top-level messages: - B -*/ -package vanity - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type B struct { - String_ *string `protobuf:"bytes,1,opt,name=String" json:"String,omitempty"` - Int64 *int64 `protobuf:"varint,2,opt,name=Int64" json:"Int64,omitempty"` - Int32 *int32 `protobuf:"varint,3,opt,name=Int32,def=1234" json:"Int32,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *B) Reset() { *m = B{} } -func (m *B) String() string { return proto.CompactTextString(m) } -func (*B) ProtoMessage() {} - -const Default_B_Int32 int32 = 1234 - -func (m *B) GetString_() string { - if m != nil && m.String_ != nil { - return *m.String_ - } - return "" -} - -func (m *B) GetInt64() int64 { - if m != nil && m.Int64 != nil { - return *m.Int64 - } - return 0 -} - -func (m *B) GetInt32() int32 { - if m != nil && m.Int32 != nil { - return *m.Int32 - } - return Default_B_Int32 -} - -func init() { - proto.RegisterType((*B)(nil), "vanity.B") -} -func (m *B) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *B) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.String_ != nil { - data[i] = 0xa - i++ - i = encodeVarintGogovanity(data, i, uint64(len(*m.String_))) - i += copy(data[i:], *m.String_) - } - if m.Int64 != nil { - data[i] = 0x10 - i++ - i = encodeVarintGogovanity(data, i, uint64(*m.Int64)) - } - if m.Int32 != nil { - data[i] = 0x18 - i++ - i = encodeVarintGogovanity(data, i, uint64(*m.Int32)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Gogovanity(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Gogovanity(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintGogovanity(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (m *B) Size() (n int) { - var l int - _ = l - if m.String_ != nil { - l = len(*m.String_) - n += 1 + l + sovGogovanity(uint64(l)) - } - if m.Int64 != nil { - n += 1 + sovGogovanity(uint64(*m.Int64)) - } - if m.Int32 != nil { - n += 1 + sovGogovanity(uint64(*m.Int32)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovGogovanity(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozGogovanity(x uint64) (n int) { - return sovGogovanity(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *B) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: B: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: B: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field String_", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGogovanity - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.String_ = &s - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int64", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Int64 = &v - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int32", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Int32 = &v - default: - iNdEx = preIndex - skippy, err := skipGogovanity(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGogovanity - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGogovanity(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthGogovanity - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGogovanity(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthGogovanity = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGogovanity = fmt.Errorf("proto: integer overflow") -) diff --git a/vendor/github.com/gogo/protobuf/vanity/test/fast/proto3.pb.go b/vendor/github.com/gogo/protobuf/vanity/test/fast/proto3.pb.go deleted file mode 100644 index ea1015fb0fe..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/fast/proto3.pb.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: proto3.proto -// DO NOT EDIT! - -/* -Package vanity is a generated protocol buffer package. - -It is generated from these files: - proto3.proto - -It has these top-level messages: - Aproto3 -*/ -package vanity - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type Aproto3 struct { - B string `protobuf:"bytes,1,opt,name=B,proto3" json:"B,omitempty"` -} - -func (m *Aproto3) Reset() { *m = Aproto3{} } -func (m *Aproto3) String() string { return proto.CompactTextString(m) } -func (*Aproto3) ProtoMessage() {} - -func init() { - proto.RegisterType((*Aproto3)(nil), "vanity.Aproto3") -} -func (m *Aproto3) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Aproto3) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.B) > 0 { - data[i] = 0xa - i++ - i = encodeVarintProto3(data, i, uint64(len(m.B))) - i += copy(data[i:], m.B) - } - return i, nil -} - -func encodeFixed64Proto3(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Proto3(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintProto3(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (m *Aproto3) Size() (n int) { - var l int - _ = l - l = len(m.B) - if l > 0 { - n += 1 + l + sovProto3(uint64(l)) - } - return n -} - -func sovProto3(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozProto3(x uint64) (n int) { - return sovProto3(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Aproto3) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto3 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Aproto3: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Aproto3: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto3 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto3 - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.B = string(data[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto3(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto3 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProto3(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthProto3 - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipProto3(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthProto3 = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProto3 = fmt.Errorf("proto: integer overflow") -) diff --git a/vendor/github.com/gogo/protobuf/vanity/test/fast/vanity.pb.go b/vendor/github.com/gogo/protobuf/vanity/test/fast/vanity.pb.go deleted file mode 100644 index 0de7bd21e63..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/fast/vanity.pb.go +++ /dev/null @@ -1,355 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: vanity.proto -// DO NOT EDIT! - -/* - Package vanity is a generated protocol buffer package. - - It is generated from these files: - vanity.proto - - It has these top-level messages: - A -*/ -package vanity - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type A struct { - Strings *string `protobuf:"bytes,1,opt,name=Strings" json:"Strings,omitempty"` - Int *int64 `protobuf:"varint,2,req,name=Int" json:"Int,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *A) Reset() { *m = A{} } -func (m *A) String() string { return proto.CompactTextString(m) } -func (*A) ProtoMessage() {} - -func (m *A) GetStrings() string { - if m != nil && m.Strings != nil { - return *m.Strings - } - return "" -} - -func (m *A) GetInt() int64 { - if m != nil && m.Int != nil { - return *m.Int - } - return 0 -} - -func init() { - proto.RegisterType((*A)(nil), "vanity.A") -} -func (m *A) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *A) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Strings != nil { - data[i] = 0xa - i++ - i = encodeVarintVanity(data, i, uint64(len(*m.Strings))) - i += copy(data[i:], *m.Strings) - } - if m.Int == nil { - return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int") - } else { - data[i] = 0x10 - i++ - i = encodeVarintVanity(data, i, uint64(*m.Int)) - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Vanity(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Vanity(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintVanity(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (m *A) Size() (n int) { - var l int - _ = l - if m.Strings != nil { - l = len(*m.Strings) - n += 1 + l + sovVanity(uint64(l)) - } - if m.Int != nil { - n += 1 + sovVanity(uint64(*m.Int)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovVanity(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozVanity(x uint64) (n int) { - return sovVanity(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *A) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: A: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: A: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Strings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVanity - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.Strings = &s - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) - } - var v int64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Int = &v - hasFields[0] |= uint64(0x00000001) - default: - iNdEx = preIndex - skippy, err := skipVanity(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthVanity - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipVanity(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthVanity - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipVanity(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthVanity = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowVanity = fmt.Errorf("proto: integer overflow") -) diff --git a/vendor/github.com/gogo/protobuf/vanity/test/faster/gogovanity.pb.go b/vendor/github.com/gogo/protobuf/vanity/test/faster/gogovanity.pb.go deleted file mode 100644 index 4c41cc0ba0c..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/faster/gogovanity.pb.go +++ /dev/null @@ -1,372 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: gogovanity.proto -// DO NOT EDIT! - -/* - Package vanity is a generated protocol buffer package. - - It is generated from these files: - gogovanity.proto - - It has these top-level messages: - B -*/ -package vanity - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type B struct { - String_ *string `protobuf:"bytes,1,opt,name=String" json:"String,omitempty"` - Int64 int64 `protobuf:"varint,2,opt,name=Int64" json:"Int64"` - Int32 *int32 `protobuf:"varint,3,opt,name=Int32,def=1234" json:"Int32,omitempty"` -} - -func (m *B) Reset() { *m = B{} } -func (m *B) String() string { return proto.CompactTextString(m) } -func (*B) ProtoMessage() {} - -const Default_B_Int32 int32 = 1234 - -func (m *B) GetString_() string { - if m != nil && m.String_ != nil { - return *m.String_ - } - return "" -} - -func (m *B) GetInt64() int64 { - if m != nil { - return m.Int64 - } - return 0 -} - -func (m *B) GetInt32() int32 { - if m != nil && m.Int32 != nil { - return *m.Int32 - } - return Default_B_Int32 -} - -func init() { - proto.RegisterType((*B)(nil), "vanity.B") -} -func (m *B) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *B) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.String_ != nil { - data[i] = 0xa - i++ - i = encodeVarintGogovanity(data, i, uint64(len(*m.String_))) - i += copy(data[i:], *m.String_) - } - data[i] = 0x10 - i++ - i = encodeVarintGogovanity(data, i, uint64(m.Int64)) - if m.Int32 != nil { - data[i] = 0x18 - i++ - i = encodeVarintGogovanity(data, i, uint64(*m.Int32)) - } - return i, nil -} - -func encodeFixed64Gogovanity(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Gogovanity(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintGogovanity(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (m *B) Size() (n int) { - var l int - _ = l - if m.String_ != nil { - l = len(*m.String_) - n += 1 + l + sovGogovanity(uint64(l)) - } - n += 1 + sovGogovanity(uint64(m.Int64)) - if m.Int32 != nil { - n += 1 + sovGogovanity(uint64(*m.Int32)) - } - return n -} - -func sovGogovanity(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozGogovanity(x uint64) (n int) { - return sovGogovanity(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *B) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: B: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: B: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field String_", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGogovanity - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.String_ = &s - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int64", wireType) - } - m.Int64 = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - m.Int64 |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int32", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Int32 = &v - default: - iNdEx = preIndex - skippy, err := skipGogovanity(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGogovanity - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGogovanity(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthGogovanity - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGogovanity(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthGogovanity = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGogovanity = fmt.Errorf("proto: integer overflow") -) diff --git a/vendor/github.com/gogo/protobuf/vanity/test/faster/proto3.pb.go b/vendor/github.com/gogo/protobuf/vanity/test/faster/proto3.pb.go deleted file mode 100644 index ea1015fb0fe..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/faster/proto3.pb.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: proto3.proto -// DO NOT EDIT! - -/* -Package vanity is a generated protocol buffer package. - -It is generated from these files: - proto3.proto - -It has these top-level messages: - Aproto3 -*/ -package vanity - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type Aproto3 struct { - B string `protobuf:"bytes,1,opt,name=B,proto3" json:"B,omitempty"` -} - -func (m *Aproto3) Reset() { *m = Aproto3{} } -func (m *Aproto3) String() string { return proto.CompactTextString(m) } -func (*Aproto3) ProtoMessage() {} - -func init() { - proto.RegisterType((*Aproto3)(nil), "vanity.Aproto3") -} -func (m *Aproto3) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Aproto3) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.B) > 0 { - data[i] = 0xa - i++ - i = encodeVarintProto3(data, i, uint64(len(m.B))) - i += copy(data[i:], m.B) - } - return i, nil -} - -func encodeFixed64Proto3(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Proto3(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintProto3(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (m *Aproto3) Size() (n int) { - var l int - _ = l - l = len(m.B) - if l > 0 { - n += 1 + l + sovProto3(uint64(l)) - } - return n -} - -func sovProto3(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozProto3(x uint64) (n int) { - return sovProto3(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Aproto3) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto3 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Aproto3: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Aproto3: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto3 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto3 - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.B = string(data[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto3(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto3 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProto3(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthProto3 - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipProto3(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthProto3 = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProto3 = fmt.Errorf("proto: integer overflow") -) diff --git a/vendor/github.com/gogo/protobuf/vanity/test/faster/vanity.pb.go b/vendor/github.com/gogo/protobuf/vanity/test/faster/vanity.pb.go deleted file mode 100644 index eda3bdd4781..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/faster/vanity.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: vanity.proto -// DO NOT EDIT! - -/* - Package vanity is a generated protocol buffer package. - - It is generated from these files: - vanity.proto - - It has these top-level messages: - A -*/ -package vanity - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import io "io" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type A struct { - Strings string `protobuf:"bytes,1,opt,name=Strings" json:"Strings"` - Int int64 `protobuf:"varint,2,req,name=Int" json:"Int"` -} - -func (m *A) Reset() { *m = A{} } -func (m *A) String() string { return proto.CompactTextString(m) } -func (*A) ProtoMessage() {} - -func (m *A) GetStrings() string { - if m != nil { - return m.Strings - } - return "" -} - -func (m *A) GetInt() int64 { - if m != nil { - return m.Int - } - return 0 -} - -func init() { - proto.RegisterType((*A)(nil), "vanity.A") -} -func (m *A) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *A) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - data[i] = 0xa - i++ - i = encodeVarintVanity(data, i, uint64(len(m.Strings))) - i += copy(data[i:], m.Strings) - data[i] = 0x10 - i++ - i = encodeVarintVanity(data, i, uint64(m.Int)) - return i, nil -} - -func encodeFixed64Vanity(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Vanity(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintVanity(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (m *A) Size() (n int) { - var l int - _ = l - l = len(m.Strings) - n += 1 + l + sovVanity(uint64(l)) - n += 1 + sovVanity(uint64(m.Int)) - return n -} - -func sovVanity(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozVanity(x uint64) (n int) { - return sovVanity(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *A) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: A: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: A: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Strings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVanity - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Strings = string(data[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) - } - m.Int = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - m.Int |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - hasFields[0] |= uint64(0x00000001) - default: - iNdEx = preIndex - skippy, err := skipVanity(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthVanity - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipVanity(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthVanity - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipVanity(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthVanity = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowVanity = fmt.Errorf("proto: integer overflow") -) diff --git a/vendor/github.com/gogo/protobuf/vanity/test/gofast/.gitignore b/vendor/github.com/gogo/protobuf/vanity/test/gofast/.gitignore deleted file mode 100644 index 9b0b440dc05..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/gofast/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.pb.go \ No newline at end of file diff --git a/vendor/github.com/gogo/protobuf/vanity/test/gogovanity.proto b/vendor/github.com/gogo/protobuf/vanity/test/gogovanity.proto deleted file mode 100644 index 5d75ec6b0d4..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/gogovanity.proto +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2015, Vastech SA (PTY) LTD. All rights reserved. -// http://github.com/gogo/protobuf/gogoproto -// -// 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. -// -// 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 = "proto2"; - -package vanity; - -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -message B { - optional string String = 1 [(gogoproto.nullable) = true]; - optional int64 Int64 = 2; - optional int32 Int32 = 3 [default = 1234]; -} diff --git a/vendor/github.com/gogo/protobuf/vanity/test/proto3.proto b/vendor/github.com/gogo/protobuf/vanity/test/proto3.proto deleted file mode 100644 index 429b6fda110..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/proto3.proto +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2015, Vastech SA (PTY) LTD. All rights reserved. -// http://github.com/gogo/protobuf/gogoproto -// -// 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. -// -// 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"; - -package vanity; - -message Aproto3 { - string B = 1; -} \ No newline at end of file diff --git a/vendor/github.com/gogo/protobuf/vanity/test/slick/gogovanity.pb.go b/vendor/github.com/gogo/protobuf/vanity/test/slick/gogovanity.pb.go deleted file mode 100644 index 827f87bba85..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/slick/gogovanity.pb.go +++ /dev/null @@ -1,486 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: gogovanity.proto -// DO NOT EDIT! - -/* - Package vanity is a generated protocol buffer package. - - It is generated from these files: - gogovanity.proto - - It has these top-level messages: - B -*/ -package vanity - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type B struct { - String_ *string `protobuf:"bytes,1,opt,name=String" json:"String,omitempty"` - Int64 int64 `protobuf:"varint,2,opt,name=Int64" json:"Int64"` - Int32 *int32 `protobuf:"varint,3,opt,name=Int32,def=1234" json:"Int32,omitempty"` -} - -func (m *B) Reset() { *m = B{} } -func (*B) ProtoMessage() {} - -const Default_B_Int32 int32 = 1234 - -func (m *B) GetString_() string { - if m != nil && m.String_ != nil { - return *m.String_ - } - return "" -} - -func (m *B) GetInt64() int64 { - if m != nil { - return m.Int64 - } - return 0 -} - -func (m *B) GetInt32() int32 { - if m != nil && m.Int32 != nil { - return *m.Int32 - } - return Default_B_Int32 -} - -func init() { - proto.RegisterType((*B)(nil), "vanity.B") -} -func (this *B) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*B) - if !ok { - that2, ok := that.(B) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.String_ != nil && that1.String_ != nil { - if *this.String_ != *that1.String_ { - return false - } - } else if this.String_ != nil { - return false - } else if that1.String_ != nil { - return false - } - if this.Int64 != that1.Int64 { - return false - } - if this.Int32 != nil && that1.Int32 != nil { - if *this.Int32 != *that1.Int32 { - return false - } - } else if this.Int32 != nil { - return false - } else if that1.Int32 != nil { - return false - } - return true -} -func (this *B) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&vanity.B{") - if this.String_ != nil { - s = append(s, "String_: "+valueToGoStringGogovanity(this.String_, "string")+",\n") - } - s = append(s, "Int64: "+fmt.Sprintf("%#v", this.Int64)+",\n") - if this.Int32 != nil { - s = append(s, "Int32: "+valueToGoStringGogovanity(this.Int32, "int32")+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringGogovanity(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringGogovanity(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *B) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *B) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.String_ != nil { - data[i] = 0xa - i++ - i = encodeVarintGogovanity(data, i, uint64(len(*m.String_))) - i += copy(data[i:], *m.String_) - } - data[i] = 0x10 - i++ - i = encodeVarintGogovanity(data, i, uint64(m.Int64)) - if m.Int32 != nil { - data[i] = 0x18 - i++ - i = encodeVarintGogovanity(data, i, uint64(*m.Int32)) - } - return i, nil -} - -func encodeFixed64Gogovanity(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Gogovanity(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintGogovanity(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (m *B) Size() (n int) { - var l int - _ = l - if m.String_ != nil { - l = len(*m.String_) - n += 1 + l + sovGogovanity(uint64(l)) - } - n += 1 + sovGogovanity(uint64(m.Int64)) - if m.Int32 != nil { - n += 1 + sovGogovanity(uint64(*m.Int32)) - } - return n -} - -func sovGogovanity(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozGogovanity(x uint64) (n int) { - return sovGogovanity(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *B) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&B{`, - `String_:` + valueToStringGogovanity(this.String_) + `,`, - `Int64:` + fmt.Sprintf("%v", this.Int64) + `,`, - `Int32:` + valueToStringGogovanity(this.Int32) + `,`, - `}`, - }, "") - return s -} -func valueToStringGogovanity(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *B) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: B: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: B: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field String_", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGogovanity - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(data[iNdEx:postIndex]) - m.String_ = &s - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int64", wireType) - } - m.Int64 = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - m.Int64 |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int32", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGogovanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - v |= (int32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Int32 = &v - default: - iNdEx = preIndex - skippy, err := skipGogovanity(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGogovanity - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGogovanity(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthGogovanity - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGogovanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGogovanity(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthGogovanity = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGogovanity = fmt.Errorf("proto: integer overflow") -) diff --git a/vendor/github.com/gogo/protobuf/vanity/test/slick/proto3.pb.go b/vendor/github.com/gogo/protobuf/vanity/test/slick/proto3.pb.go deleted file mode 100644 index ddd53c09cc6..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/slick/proto3.pb.go +++ /dev/null @@ -1,382 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: proto3.proto -// DO NOT EDIT! - -/* -Package vanity is a generated protocol buffer package. - -It is generated from these files: - proto3.proto - -It has these top-level messages: - Aproto3 -*/ -package vanity - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type Aproto3 struct { - B string `protobuf:"bytes,1,opt,name=B,proto3" json:"B,omitempty"` -} - -func (m *Aproto3) Reset() { *m = Aproto3{} } -func (*Aproto3) ProtoMessage() {} - -func init() { - proto.RegisterType((*Aproto3)(nil), "vanity.Aproto3") -} -func (this *Aproto3) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*Aproto3) - if !ok { - that2, ok := that.(Aproto3) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.B != that1.B { - return false - } - return true -} -func (this *Aproto3) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&vanity.Aproto3{") - s = append(s, "B: "+fmt.Sprintf("%#v", this.B)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringProto3(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringProto3(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *Aproto3) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *Aproto3) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.B) > 0 { - data[i] = 0xa - i++ - i = encodeVarintProto3(data, i, uint64(len(m.B))) - i += copy(data[i:], m.B) - } - return i, nil -} - -func encodeFixed64Proto3(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Proto3(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintProto3(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (m *Aproto3) Size() (n int) { - var l int - _ = l - l = len(m.B) - if l > 0 { - n += 1 + l + sovProto3(uint64(l)) - } - return n -} - -func sovProto3(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozProto3(x uint64) (n int) { - return sovProto3(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Aproto3) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Aproto3{`, - `B:` + fmt.Sprintf("%v", this.B) + `,`, - `}`, - }, "") - return s -} -func valueToStringProto3(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Aproto3) Unmarshal(data []byte) error { - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto3 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Aproto3: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Aproto3: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field B", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProto3 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthProto3 - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.B = string(data[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProto3(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthProto3 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipProto3(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthProto3 - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowProto3 - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipProto3(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthProto3 = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProto3 = fmt.Errorf("proto: integer overflow") -) diff --git a/vendor/github.com/gogo/protobuf/vanity/test/slick/vanity.pb.go b/vendor/github.com/gogo/protobuf/vanity/test/slick/vanity.pb.go deleted file mode 100644 index 5b4ff38fdee..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/slick/vanity.pb.go +++ /dev/null @@ -1,426 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: vanity.proto -// DO NOT EDIT! - -/* - Package vanity is a generated protocol buffer package. - - It is generated from these files: - vanity.proto - - It has these top-level messages: - A -*/ -package vanity - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" - -import strings "strings" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type A struct { - Strings string `protobuf:"bytes,1,opt,name=Strings" json:"Strings"` - Int int64 `protobuf:"varint,2,req,name=Int" json:"Int"` -} - -func (m *A) Reset() { *m = A{} } -func (*A) ProtoMessage() {} - -func (m *A) GetStrings() string { - if m != nil { - return m.Strings - } - return "" -} - -func (m *A) GetInt() int64 { - if m != nil { - return m.Int - } - return 0 -} - -func init() { - proto.RegisterType((*A)(nil), "vanity.A") -} -func (this *A) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*A) - if !ok { - that2, ok := that.(A) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if this.Strings != that1.Strings { - return false - } - if this.Int != that1.Int { - return false - } - return true -} -func (this *A) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&vanity.A{") - s = append(s, "Strings: "+fmt.Sprintf("%#v", this.Strings)+",\n") - s = append(s, "Int: "+fmt.Sprintf("%#v", this.Int)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringVanity(v interface{}, typ string) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringVanity(e map[int32]github_com_gogo_protobuf_proto.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings.Join(ss, ",") + "}" - return s -} -func (m *A) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *A) MarshalTo(data []byte) (int, error) { - var i int - _ = i - var l int - _ = l - data[i] = 0xa - i++ - i = encodeVarintVanity(data, i, uint64(len(m.Strings))) - i += copy(data[i:], m.Strings) - data[i] = 0x10 - i++ - i = encodeVarintVanity(data, i, uint64(m.Int)) - return i, nil -} - -func encodeFixed64Vanity(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Vanity(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintVanity(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (m *A) Size() (n int) { - var l int - _ = l - l = len(m.Strings) - n += 1 + l + sovVanity(uint64(l)) - n += 1 + sovVanity(uint64(m.Int)) - return n -} - -func sovVanity(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozVanity(x uint64) (n int) { - return sovVanity(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *A) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&A{`, - `Strings:` + fmt.Sprintf("%v", this.Strings) + `,`, - `Int:` + fmt.Sprintf("%v", this.Int) + `,`, - `}`, - }, "") - return s -} -func valueToStringVanity(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *A) Unmarshal(data []byte) error { - var hasFields [1]uint64 - l := len(data) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: A: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: A: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Strings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVanity - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Strings = string(data[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) - } - m.Int = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVanity - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - m.Int |= (int64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - hasFields[0] |= uint64(0x00000001) - default: - iNdEx = preIndex - skippy, err := skipVanity(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthVanity - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - if hasFields[0]&uint64(0x00000001) == 0 { - return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int") - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipVanity(data []byte) (n int, err error) { - l := len(data) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if data[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthVanity - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVanity - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := data[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipVanity(data[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthVanity = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowVanity = fmt.Errorf("proto: integer overflow") -) diff --git a/vendor/github.com/gogo/protobuf/vanity/test/vanity.proto b/vendor/github.com/gogo/protobuf/vanity/test/vanity.proto deleted file mode 100644 index 08115380699..00000000000 --- a/vendor/github.com/gogo/protobuf/vanity/test/vanity.proto +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2015, Vastech SA (PTY) LTD. All rights reserved. -// http://github.com/gogo/protobuf/gogoproto -// -// 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. -// -// 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 = "proto2"; - -package vanity; - -message A { - optional string Strings = 1; - required int64 Int = 2; -} diff --git a/vendor/github.com/golang/mock/gomock/mock_matcher/mock_matcher.go b/vendor/github.com/golang/mock/gomock/mock_matcher/mock_matcher.go deleted file mode 100644 index cd306b2559a..00000000000 --- a/vendor/github.com/golang/mock/gomock/mock_matcher/mock_matcher.go +++ /dev/null @@ -1,49 +0,0 @@ -// Automatically generated by MockGen. DO NOT EDIT! -// Source: github.com/golang/mock/gomock (interfaces: Matcher) - -package mock_gomock - -import ( - gomock "github.com/golang/mock/gomock" -) - -// Mock of Matcher interface -type MockMatcher struct { - ctrl *gomock.Controller - recorder *_MockMatcherRecorder -} - -// Recorder for MockMatcher (not exported) -type _MockMatcherRecorder struct { - mock *MockMatcher -} - -func NewMockMatcher(ctrl *gomock.Controller) *MockMatcher { - mock := &MockMatcher{ctrl: ctrl} - mock.recorder = &_MockMatcherRecorder{mock} - return mock -} - -func (_m *MockMatcher) EXPECT() *_MockMatcherRecorder { - return _m.recorder -} - -func (_m *MockMatcher) Matches(_param0 interface{}) bool { - ret := _m.ctrl.Call(_m, "Matches", _param0) - ret0, _ := ret[0].(bool) - return ret0 -} - -func (_mr *_MockMatcherRecorder) Matches(arg0 interface{}) *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "Matches", arg0) -} - -func (_m *MockMatcher) String() string { - ret := _m.ctrl.Call(_m, "String") - ret0, _ := ret[0].(string) - return ret0 -} - -func (_mr *_MockMatcherRecorder) String() *gomock.Call { - return _mr.mock.ctrl.RecordCall(_mr.mock, "String") -} 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 37c77820921..00000000000 --- 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 e2311d9294d..00000000000 --- 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/google/cadvisor/Godeps/_workspace/src/github.com/SeanDolphin/bqschema/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/SeanDolphin/bqschema/LICENSE deleted file mode 100644 index 902306b9d27..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/SeanDolphin/bqschema/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 2015 Sean Dolphin - - 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. \ No newline at end of file diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/Sirupsen/logrus/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/Sirupsen/logrus/LICENSE deleted file mode 100644 index f090cb42f37..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/Sirupsen/logrus/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Simon Eskildsen - -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/google/cadvisor/Godeps/_workspace/src/github.com/abbot/go-http-auth/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/abbot/go-http-auth/LICENSE deleted file mode 100644 index e454a52586f..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/abbot/go-http-auth/LICENSE +++ /dev/null @@ -1,178 +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 - diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/aws/aws-sdk-go/LICENSE.txt b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/aws/aws-sdk-go/LICENSE.txt deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/aws/aws-sdk-go/LICENSE.txt +++ /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/google/cadvisor/Godeps/_workspace/src/github.com/aws/aws-sdk-go/NOTICE.txt b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/aws/aws-sdk-go/NOTICE.txt deleted file mode 100644 index 5f14d1162ed..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/aws/aws-sdk-go/NOTICE.txt +++ /dev/null @@ -1,3 +0,0 @@ -AWS SDK for Go -Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. -Copyright 2014-2015 Stripe, Inc. diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/coreos/go-systemd/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/coreos/go-systemd/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/coreos/go-systemd/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/google/cadvisor/Godeps/_workspace/src/github.com/coreos/rkt/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/coreos/rkt/LICENSE deleted file mode 100644 index 5c304d1a4a7..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/coreos/rkt/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/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/LICENSE deleted file mode 100644 index c7a3f0cfd45..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://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 2013-2015 Docker, Inc. - - 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 - - https://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/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/NOTICE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/NOTICE deleted file mode 100644 index 6e6f469ab9b..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/NOTICE +++ /dev/null @@ -1,19 +0,0 @@ -Docker -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (https://www.docker.com). - -This product contains software (https://github.com/kr/pty) developed -by Keith Rarick, licensed under the MIT License. - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see https://www.bis.doc.gov - -See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/contrib/docker-engine-selinux/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/contrib/docker-engine-selinux/LICENSE deleted file mode 100644 index 4362b49151d..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/contrib/docker-engine-selinux/LICENSE +++ /dev/null @@ -1,502 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -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 this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -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 -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser 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 Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "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 -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY 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 -LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey 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 library 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 2.1 of the License, or (at your option) any later version. - - This library 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 this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/contrib/syntax/vim/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/contrib/syntax/vim/LICENSE deleted file mode 100644 index e67cdabd22e..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/contrib/syntax/vim/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Honza Pokorny -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/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/LICENSE deleted file mode 100644 index ac74d8f0496..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014-2015 The Docker & 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/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.APACHE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.APACHE deleted file mode 100644 index 9e4bd4dbee9..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.APACHE +++ /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 2014-2015 Docker, Inc. - - 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/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD deleted file mode 100644 index ac74d8f0496..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014-2015 The Docker & 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/google/cadvisor/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.code b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.code deleted file mode 100644 index b55b37bc316..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.code +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://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 Docker, Inc. - - 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 - - https://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/google/cadvisor/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.docs b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.docs deleted file mode 100644 index e26cd4fc8ed..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.docs +++ /dev/null @@ -1,425 +0,0 @@ -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More_considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the "Licensor." Except for the limited purpose of indicating -that material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/eapache/go-resiliency/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/eapache/go-resiliency/LICENSE deleted file mode 100644 index 698a3f51397..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/eapache/go-resiliency/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Evan Huus - -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/google/cadvisor/Godeps/_workspace/src/github.com/eapache/queue/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/eapache/queue/LICENSE deleted file mode 100644 index d5f36dbcaaf..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/eapache/queue/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Evan Huus - -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/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/LICENSE deleted file mode 100644 index b1cdd4cd20c..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2016, go-dockerclient 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. - -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/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/LICENSE deleted file mode 100644 index f090cb42f37..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Simon Eskildsen - -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/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.code b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.code deleted file mode 100644 index b55b37bc316..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.code +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://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 Docker, Inc. - - 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 - - https://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/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.docs b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.docs deleted file mode 100644 index e26cd4fc8ed..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.docs +++ /dev/null @@ -1,425 +0,0 @@ -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More_considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the "Licensor." Except for the limited purpose of indicating -that material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp/LICENSE deleted file mode 100644 index e87a115e462..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp/LICENSE +++ /dev/null @@ -1,363 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/go-ini/ini/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/go-ini/ini/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/go-ini/ini/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/google/cadvisor/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE deleted file mode 100644 index 670d88fcaaf..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2013, Georg Reinke (), Google -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/google/cadvisor/Godeps/_workspace/src/github.com/golang/glog/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/golang/glog/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/github.com/google/cadvisor/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/google/cadvisor/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE deleted file mode 100644 index 1b1b1921efa..00000000000 --- a/vendor/github.com/google/cadvisor/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/google/cadvisor/Godeps/_workspace/src/github.com/golang/snappy/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/golang/snappy/LICENSE deleted file mode 100644 index 6050c10f4c8..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/golang/snappy/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 The Snappy-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/google/cadvisor/Godeps/_workspace/src/github.com/influxdb/influxdb/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/influxdb/influxdb/LICENSE deleted file mode 100644 index d50222706cf..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/influxdb/influxdb/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2015 Errplane Inc. - -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/google/cadvisor/Godeps/_workspace/src/github.com/influxdb/influxdb/LICENSE_OF_DEPENDENCIES.md b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/influxdb/influxdb/LICENSE_OF_DEPENDENCIES.md deleted file mode 100644 index 7aae45f9dbb..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/influxdb/influxdb/LICENSE_OF_DEPENDENCIES.md +++ /dev/null @@ -1,19 +0,0 @@ -# List -- github.com/gogo/protobuf/proto [BSD LICENSE](https://github.com/gogo/protobuf/blob/master/LICENSE) -- gopkg.in/fatih/pool.v2 [MIT LICENSE](https://github.com/fatih/pool/blob/v2.0.0/LICENSE) -- github.com/BurntSushi/toml [WTFPL LICENSE](https://github.com/BurntSushi/toml/blob/master/COPYING) -- github.com/peterh/liner [MIT LICENSE](https://github.com/peterh/liner/blob/master/COPYING) -- github.com/davecgh/go-spew/spew [ISC LICENSE](https://github.com/davecgh/go-spew/blob/master/LICENSE) -- github.com/hashicorp/raft [MPL LICENSE](https://github.com/hashicorp/raft/blob/master/LICENSE) -- github.com/rakyll/statik/fs [APACHE LICENSE](https://github.com/rakyll/statik/blob/master/LICENSE) -- github.com/kimor79/gollectd [BSD LICENSE](https://github.com/kimor79/gollectd/blob/master/LICENSE) -- github.com/bmizerany/pat [MIT LICENSE](https://github.com/bmizerany/pat#license) -- react 0.13.3 [BSD LICENSE](https://github.com/facebook/react/blob/master/LICENSE) -- bootstrap 3.3.5 [MIT LICENSE](https://github.com/twbs/bootstrap/blob/master/LICENSE) -- jquery 2.1.4 [MIT LICENSE](https://github.com/jquery/jquery/blob/master/LICENSE.txt) -- glyphicons [LICENSE](http://glyphicons.com/license/) -- github.com/golang/snappy [BSD LICENSE](https://github.com/golang/snappy/blob/master/LICENSE) -- github.com/boltdb/bolt [MIT LICENSE](https://github.com/boltdb/bolt/blob/master/LICENSE) -- collectd.org [ISC LICENSE](https://github.com/collectd/go-collectd/blob/master/LICENSE) -- golang.org/x/crypto/* [BSD LICENSE](https://github.com/golang/crypto/blob/master/LICENSE) - diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/jmespath/go-jmespath/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/jmespath/go-jmespath/LICENSE deleted file mode 100644 index b03310a91fd..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/jmespath/go-jmespath/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2015 James Saryerwinnie - -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/google/cadvisor/Godeps/_workspace/src/github.com/klauspost/crc32/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/klauspost/crc32/LICENSE deleted file mode 100644 index 4fd5963e39c..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/klauspost/crc32/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. -Copyright (c) 2015 Klaus Post - -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/google/cadvisor/Godeps/_workspace/src/github.com/kr/pretty/License b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/kr/pretty/License deleted file mode 100644 index 05c783ccf68..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/kr/pretty/License +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright 2012 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/google/cadvisor/Godeps/_workspace/src/github.com/kr/text/License b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/kr/text/License deleted file mode 100644 index 480a3280599..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/kr/text/License +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2012 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/google/cadvisor/Godeps/_workspace/src/github.com/matttproud/golang_protobuf_extensions/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/matttproud/golang_protobuf_extensions/LICENSE deleted file mode 100644 index 13f15dfce0c..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/matttproud/golang_protobuf_extensions/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 2013 Matt T. Proud - - 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/google/cadvisor/Godeps/_workspace/src/github.com/mistifyio/go-zfs/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/mistifyio/go-zfs/LICENSE deleted file mode 100644 index f4c265cfec5..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/mistifyio/go-zfs/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 (c) 2014, OmniTI Computer Consulting, Inc. - - 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. \ No newline at end of file diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/opencontainers/runc/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/opencontainers/runc/LICENSE deleted file mode 100644 index 27448585ad4..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/opencontainers/runc/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 2014 Docker, Inc. - - 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/google/cadvisor/Godeps/_workspace/src/github.com/opencontainers/runc/NOTICE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/opencontainers/runc/NOTICE deleted file mode 100644 index 5c97abce4b9..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/opencontainers/runc/NOTICE +++ /dev/null @@ -1,17 +0,0 @@ -runc - -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (http://www.docker.com). - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see http://www.bis.doc.gov - -See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE deleted file mode 100644 index 5dc68268d90..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009,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/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_golang/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_golang/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_golang/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/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_golang/NOTICE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_golang/NOTICE deleted file mode 100644 index 37e4a7d410e..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_golang/NOTICE +++ /dev/null @@ -1,28 +0,0 @@ -Prometheus instrumentation library for Go applications -Copyright 2012-2015 The Prometheus Authors - -This product includes software developed at -SoundCloud Ltd. (http://soundcloud.com/). - - -The following components are included in this product: - -goautoneg -http://bitbucket.org/ww/goautoneg -Copyright 2011, Open Knowledge Foundation Ltd. -See README.txt for license details. - -perks - a fork of https://github.com/bmizerany/perks -https://github.com/beorn7/perks -Copyright 2013-2015 Blake Mizerany, Björn Rabenstein -See https://github.com/beorn7/perks/blob/master/README.md for license details. - -Go support for Protocol Buffers - Google's data interchange format -http://github.com/golang/protobuf/ -Copyright 2010 The Go Authors -See source code for license details. - -Support for streaming Protocol Buffer messages for the Go language (golang). -https://github.com/matttproud/golang_protobuf_extensions -Copyright 2013 Matt T. Proud -Licensed under the Apache License, Version 2.0 diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_model/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_model/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_model/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/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_model/NOTICE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_model/NOTICE deleted file mode 100644 index 20110e410e5..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_model/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -Data model artifacts for Prometheus. -Copyright 2012-2015 The Prometheus Authors - -This product includes software developed at -SoundCloud Ltd. (http://soundcloud.com/). diff --git a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_model/ruby/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_model/ruby/LICENSE deleted file mode 100644 index 11069edd790..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/client_model/ruby/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/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/procfs/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/procfs/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/github.com/google/cadvisor/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/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/procfs/NOTICE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/prometheus/procfs/NOTICE deleted file mode 100644 index 53c5e9aa111..00000000000 --- a/vendor/github.com/google/cadvisor/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/google/cadvisor/Godeps/_workspace/src/github.com/seccomp/libseccomp-golang/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/seccomp/libseccomp-golang/LICENSE deleted file mode 100644 index 81cf60de29e..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/seccomp/libseccomp-golang/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2015 Matthew Heon -Copyright (c) 2015 Paul Moore -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. - -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/google/cadvisor/Godeps/_workspace/src/github.com/stretchr/objx/LICENSE.md b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/stretchr/objx/LICENSE.md deleted file mode 100644 index 2199945813c..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/stretchr/objx/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -objx - by Mat Ryer and Tyler Bunnell - -The MIT License (MIT) - -Copyright (c) 2014 Stretchr, Inc. - -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/google/cadvisor/Godeps/_workspace/src/github.com/syndtr/gocapability/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/syndtr/gocapability/LICENSE deleted file mode 100644 index 80dd96de77f..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/syndtr/gocapability/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2013 Suryandaru Triandana -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. - -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/google/cadvisor/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE deleted file mode 100644 index 9f64db8582c..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE +++ /dev/null @@ -1,192 +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 2014 Vishvananda Ishaya. - Copyright 2014 Docker, Inc. - - 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/google/cadvisor/Godeps/_workspace/src/golang.org/x/exp/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/golang.org/x/exp/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/golang.org/x/exp/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/google/cadvisor/Godeps/_workspace/src/golang.org/x/exp/PATENTS b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/golang.org/x/exp/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/golang.org/x/exp/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/google/cadvisor/Godeps/_workspace/src/golang.org/x/net/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/golang.org/x/net/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/github.com/google/cadvisor/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/google/cadvisor/Godeps/_workspace/src/golang.org/x/net/PATENTS b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/golang.org/x/net/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/github.com/google/cadvisor/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/google/cadvisor/Godeps/_workspace/src/golang.org/x/oauth2/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/golang.org/x/oauth2/LICENSE deleted file mode 100644 index d02f24fd528..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/golang.org/x/oauth2/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The oauth2 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/google/cadvisor/Godeps/_workspace/src/google.golang.org/api/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/google.golang.org/api/LICENSE deleted file mode 100644 index 263aa7a0c12..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/google.golang.org/api/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 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/google/cadvisor/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE deleted file mode 100644 index de9c88cb65c..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright (c) 2013 Joshua Tacoma - -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/google/cadvisor/Godeps/_workspace/src/google.golang.org/cloud/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/google.golang.org/cloud/LICENSE deleted file mode 100644 index a4c5efd822f..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/google.golang.org/cloud/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 2014 Google Inc. - - 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/google/cadvisor/Godeps/_workspace/src/google.golang.org/grpc/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/google.golang.org/grpc/LICENSE deleted file mode 100644 index f4988b45079..00000000000 --- a/vendor/github.com/google/cadvisor/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/google/cadvisor/Godeps/_workspace/src/google.golang.org/grpc/PATENTS b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/google.golang.org/grpc/PATENTS deleted file mode 100644 index 619f9dbfe63..00000000000 --- a/vendor/github.com/google/cadvisor/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/google/cadvisor/Godeps/_workspace/src/gopkg.in/olivere/elastic.v2/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/gopkg.in/olivere/elastic.v2/LICENSE deleted file mode 100644 index 8b22cdb6014..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/gopkg.in/olivere/elastic.v2/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) -Copyright © 2012-2015 Oliver Eilhard - -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/google/cadvisor/Godeps/_workspace/src/gopkg.in/olivere/elastic.v2/uritemplates/LICENSE b/vendor/github.com/google/cadvisor/Godeps/_workspace/src/gopkg.in/olivere/elastic.v2/uritemplates/LICENSE deleted file mode 100644 index de9c88cb65c..00000000000 --- a/vendor/github.com/google/cadvisor/Godeps/_workspace/src/gopkg.in/olivere/elastic.v2/uritemplates/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright (c) 2013 Joshua Tacoma - -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/google/cadvisor/collector/config/sample_config.json b/vendor/github.com/google/cadvisor/collector/config/sample_config.json deleted file mode 100644 index d1f9000cab4..00000000000 --- a/vendor/github.com/google/cadvisor/collector/config/sample_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "endpoint" : "http://localhost:8000/nginx_status", - "metrics_config" : [ - { "name" : "activeConnections", - "metric_type" : "gauge", - "units" : "number of active connections", - "data_type" : "int", - "polling_frequency" : 10, - "regex" : "Active connections: ([0-9]+)" - }, - { "name" : "reading", - "metric_type" : "gauge", - "units" : "number of reading connections", - "data_type" : "int", - "polling_frequency" : 10, - "regex" : "Reading: ([0-9]+) .*" - }, - { "name" : "writing", - "metric_type" : "gauge", - "data_type" : "int", - "units" : "number of writing connections", - "polling_frequency" : 10, - "regex" : ".*Writing: ([0-9]+).*" - }, - { "name" : "waiting", - "metric_type" : "gauge", - "units" : "number of waiting connections", - "data_type" : "int", - "polling_frequency" : 10, - "regex" : ".*Waiting: ([0-9]+)" - } - ] - -} diff --git a/vendor/github.com/google/cadvisor/collector/config/sample_config_prometheus.json b/vendor/github.com/google/cadvisor/collector/config/sample_config_prometheus.json deleted file mode 100644 index cc74bb727d0..00000000000 --- a/vendor/github.com/google/cadvisor/collector/config/sample_config_prometheus.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "endpoint" : "http://localhost:8080/metrics", - "polling_frequency" : 10, - "metrics_config" : [ - ] -} diff --git a/vendor/github.com/google/cadvisor/collector/config/sample_config_prometheus_filtered.json b/vendor/github.com/google/cadvisor/collector/config/sample_config_prometheus_filtered.json deleted file mode 100644 index 672f075999f..00000000000 --- a/vendor/github.com/google/cadvisor/collector/config/sample_config_prometheus_filtered.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "endpoint" : "http://localhost:8080/metrics", - "polling_frequency" : 10, - "metrics_config" : [ - "go_goroutines", - "qps" - ] -} - diff --git a/vendor/github.com/google/cadvisor/container/common/test_resources/container_hints.json b/vendor/github.com/google/cadvisor/container/common/test_resources/container_hints.json deleted file mode 100644 index d8842e5539b..00000000000 --- a/vendor/github.com/google/cadvisor/container/common/test_resources/container_hints.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "Container Hints", - "description": "Container hints file", - "all_hosts": [ - { - "network_interface": { - "veth_child": "eth1", - "veth_host": "veth24031eth1" - }, - "mounts": [ - { - "host_dir": "/var/run/nm-sdc1", - "container_dir": "/var/run/nm-sdc1", - "permission": "rw" - }, - { - "host_dir": "/var/run/nm-sdb3", - "container_dir": "/var/run/nm-sdb3", - "permission": "rw" - }, - { - "host_dir": "/var/run/nm-sda3", - "container_dir": "/var/run/nm-sda3", - "permission": "rw" - }, - { - "host_dir": "/var/run/netns/root", - "container_dir": "/var/run/netns/root", - "permission": "ro" - }, - { - "host_dir": "/var/run/openvswitch/db.sock", - "container_dir": "/var/run/openvswitch/db.sock", - "permission": "rw" - } - ], - "full_path": "18a4585950db428e4d5a65c216a5d708d241254709626f4cb300ee963fb4b144" - } - ] -} diff --git a/vendor/github.com/google/cadvisor/fs/test_resources/diskstats b/vendor/github.com/google/cadvisor/fs/test_resources/diskstats deleted file mode 100644 index ee4d233b0d2..00000000000 --- a/vendor/github.com/google/cadvisor/fs/test_resources/diskstats +++ /dev/null @@ -1,54 +0,0 @@ - 1 0 ram0 0 0 0 0 0 0 0 0 0 0 0 - 1 1 ram1 0 0 0 0 0 0 0 0 0 0 0 - 1 2 ram2 0 0 0 0 0 0 0 0 0 0 0 - 1 3 ram3 0 0 0 0 0 0 0 0 0 0 0 - 1 4 ram4 0 0 0 0 0 0 0 0 0 0 0 - 1 5 ram5 0 0 0 0 0 0 0 0 0 0 0 - 1 6 ram6 0 0 0 0 0 0 0 0 0 0 0 - 1 7 ram7 0 0 0 0 0 0 0 0 0 0 0 - 1 8 ram8 0 0 0 0 0 0 0 0 0 0 0 - 1 9 ram9 0 0 0 0 0 0 0 0 0 0 0 - 1 10 ram10 0 0 0 0 0 0 0 0 0 0 0 - 1 11 ram11 0 0 0 0 0 0 0 0 0 0 0 - 1 12 ram12 0 0 0 0 0 0 0 0 0 0 0 - 1 13 ram13 0 0 0 0 0 0 0 0 0 0 0 - 1 14 ram14 0 0 0 0 0 0 0 0 0 0 0 - 1 15 ram15 0 0 0 0 0 0 0 0 0 0 0 - 7 0 loop0 0 0 0 0 0 0 0 0 0 0 0 - 7 1 loop1 0 0 0 0 0 0 0 0 0 0 0 - 7 2 loop2 0 0 0 0 0 0 0 0 0 0 0 - 7 3 loop3 0 0 0 0 0 0 0 0 0 0 0 - 7 4 loop4 0 0 0 0 0 0 0 0 0 0 0 - 7 5 loop5 0 0 0 0 0 0 0 0 0 0 0 - 7 6 loop6 0 0 0 0 0 0 0 0 0 0 0 - 7 7 loop7 0 0 0 0 0 0 0 0 0 0 0 - 8 16 sdb 931 1157 7601 960 2 0 16 0 0 919 960 - 8 17 sdb1 477 1147 3895 271 1 0 8 0 0 271 271 - 8 18 sdb2 395 0 3154 326 1 0 8 0 0 326 326 - 8 0 sda 931 1157 7601 1065 2 0 16 0 0 873 1065 - 8 1 sda1 477 1147 3895 419 1 0 8 0 0 419 419 - 8 2 sda2 395 0 3154 328 1 0 8 0 0 328 328 - 8 32 sdc 12390 470 457965 36363 72184 244851 9824537 5359169 0 607738 5437210 - 8 33 sdc1 10907 221 446193 34366 72173 244851 9824499 5359063 0 606972 5435214 - 8 34 sdc2 650 249 5120 901 7 0 22 93 0 956 994 - 8 35 sdc3 264 0 2106 380 1 0 8 0 0 380 380 - 8 36 sdc4 392 0 3130 476 1 0 8 0 0 475 475 - 8 48 sdd 3371 134 58909 18327 73997 243043 9824537 4532714 0 594248 4602162 - 8 49 sdd1 2498 134 51977 17192 73986 243043 9824499 4532600 0 593618 4600885 - 8 50 sdd2 40 0 280 223 7 0 22 108 0 330 330 - 8 51 sdd3 264 0 2106 328 1 0 8 0 0 328 328 - 8 52 sdd4 392 0 3130 373 1 0 8 1 0 374 374 - 8 64 sde 931 1157 7601 768 2 0 16 0 0 632 768 - 8 65 sde1 477 1147 3895 252 1 0 8 0 0 252 252 - 8 66 sde2 395 0 3154 281 1 0 8 0 0 281 281 - 8 80 sdf 931 1157 7601 936 2 0 16 0 0 717 936 - 8 81 sdf1 477 1147 3895 382 1 0 8 0 0 382 382 - 8 82 sdf2 395 0 3154 321 1 0 8 0 0 321 321 - 8 96 sdg 931 1157 7601 858 2 0 16 0 0 804 858 - 8 97 sdg1 477 1147 3895 244 1 0 8 0 0 244 244 - 8 98 sdg2 395 0 3154 299 1 0 8 0 0 299 299 - 8 112 sdh 931 1157 7601 895 2 0 16 0 0 841 895 - 8 113 sdh1 477 1147 3895 264 1 0 8 0 0 264 264 - 8 114 sdh2 395 0 3154 311 1 0 8 0 0 311 311 - 252 0 dm-0 1251094 0 108121362 21287644 111848 0 52908472 22236936 0 4838500 43524784 - 252 1 dm-1 58415638 0 2682446960 1719953592 20048040 0 543988240 1975572544 0 262085340 3695556828 diff --git a/vendor/github.com/google/cadvisor/storage/bigquery/README.md b/vendor/github.com/google/cadvisor/storage/bigquery/README.md deleted file mode 100644 index eefbe285256..00000000000 --- a/vendor/github.com/google/cadvisor/storage/bigquery/README.md +++ /dev/null @@ -1,29 +0,0 @@ -BigQuery Storage Driver -======= - -[EXPERIMENTAL] Support for BigQuery backend as cAdvisor storage driver. -The current implementation takes bunch of BigQuery specific flags for authentication. -These will be merged into a single backend config. - -To run the current version, following flags need to be specified: -``` - # Storage driver to use. - -storage_driver=bigquery - - # Information about server-to-server Oauth token. - # These can be obtained by creating a Service Account client id under `Google Developer API` - - # service client id - -bq_id="XYZ.apps.googleusercontent.com" - - # service email address - -bq_account="ABC@developer.gserviceaccount.com" - - # path to pem key (converted from p12 file) - -bq_credentials_file="/path/to/key.pem" - - # project id to use for storing datasets. - -bq_project_id="awesome_project" -``` - -See [Service account Authentication](https://developers.google.com/accounts/docs/OAuth2) for Oauth related details. diff --git a/vendor/github.com/google/cadvisor/storage/bigquery/bigquery.go b/vendor/github.com/google/cadvisor/storage/bigquery/bigquery.go deleted file mode 100644 index 316f8f3c709..00000000000 --- a/vendor/github.com/google/cadvisor/storage/bigquery/bigquery.go +++ /dev/null @@ -1,312 +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 bigquery - -import ( - "os" - - info "github.com/google/cadvisor/info/v1" - "github.com/google/cadvisor/storage" - "github.com/google/cadvisor/storage/bigquery/client" - - bigquery "google.golang.org/api/bigquery/v2" -) - -func init() { - storage.RegisterStorageDriver("bigquery", new) -} - -type bigqueryStorage struct { - client *client.Client - machineName string -} - -const ( - // Bigquery schema types - typeTimestamp string = "TIMESTAMP" - typeString string = "STRING" - typeInteger string = "INTEGER" - - colTimestamp string = "timestamp" - colMachineName string = "machine" - colContainerName string = "container_name" - colCpuCumulativeUsage string = "cpu_cumulative_usage" - // Cumulative Cpu usage in system and user mode - colCpuCumulativeUsageSystem string = "cpu_cumulative_usage_system" - colCpuCumulativeUsageUser string = "cpu_cumulative_usage_user" - // Memory usage - colMemoryUsage string = "memory_usage" - // Working set size - colMemoryWorkingSet string = "memory_working_set" - // Container page fault - colMemoryContainerPgfault string = "memory_container_pgfault" - // Constainer major page fault - colMemoryContainerPgmajfault string = "memory_container_pgmajfault" - // Hierarchical page fault - colMemoryHierarchicalPgfault string = "memory_hierarchical_pgfault" - // Hierarchical major page fault - colMemoryHierarchicalPgmajfault string = "memory_hierarchical_pgmajfault" - // Cumulative count of bytes received. - colRxBytes string = "rx_bytes" - // Cumulative count of receive errors encountered. - colRxErrors string = "rx_errors" - // Cumulative count of bytes transmitted. - colTxBytes string = "tx_bytes" - // Cumulative count of transmit errors encountered. - colTxErrors string = "tx_errors" - // Filesystem device. - colFsDevice = "fs_device" - // Filesystem limit. - colFsLimit = "fs_limit" - // Filesystem available space. - colFsUsage = "fs_usage" -) - -func new() (storage.StorageDriver, error) { - hostname, err := os.Hostname() - if err != nil { - return nil, err - } - return newStorage( - hostname, - *storage.ArgDbTable, - *storage.ArgDbName, - ) -} - -// TODO(jnagal): Infer schema through reflection. (See bigquery/client/example) -func (self *bigqueryStorage) GetSchema() *bigquery.TableSchema { - fields := make([]*bigquery.TableFieldSchema, 19) - i := 0 - fields[i] = &bigquery.TableFieldSchema{ - Type: typeTimestamp, - Name: colTimestamp, - Mode: "REQUIRED", - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeString, - Name: colMachineName, - Mode: "REQUIRED", - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeString, - Name: colContainerName, - Mode: "REQUIRED", - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colCpuCumulativeUsage, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colCpuCumulativeUsageSystem, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colCpuCumulativeUsageUser, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colMemoryUsage, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colMemoryWorkingSet, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colMemoryContainerPgfault, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colMemoryContainerPgmajfault, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colMemoryHierarchicalPgfault, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colMemoryHierarchicalPgmajfault, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colRxBytes, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colRxErrors, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colTxBytes, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colTxErrors, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeString, - Name: colFsDevice, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colFsLimit, - } - i++ - fields[i] = &bigquery.TableFieldSchema{ - Type: typeInteger, - Name: colFsUsage, - } - return &bigquery.TableSchema{ - Fields: fields, - } -} - -func (self *bigqueryStorage) containerStatsToRows( - ref info.ContainerReference, - stats *info.ContainerStats, -) (row map[string]interface{}) { - row = make(map[string]interface{}) - - // Timestamp - row[colTimestamp] = stats.Timestamp - - // Machine name - row[colMachineName] = self.machineName - - // Container name - name := ref.Name - if len(ref.Aliases) > 0 { - name = ref.Aliases[0] - } - row[colContainerName] = name - - // Cumulative Cpu Usage - row[colCpuCumulativeUsage] = stats.Cpu.Usage.Total - - // Cumulative Cpu Usage in system mode - row[colCpuCumulativeUsageSystem] = stats.Cpu.Usage.System - - // Cumulative Cpu Usage in user mode - row[colCpuCumulativeUsageUser] = stats.Cpu.Usage.User - - // Memory Usage - row[colMemoryUsage] = stats.Memory.Usage - - // Working set size - row[colMemoryWorkingSet] = stats.Memory.WorkingSet - - // container page fault - row[colMemoryContainerPgfault] = stats.Memory.ContainerData.Pgfault - - // container major page fault - row[colMemoryContainerPgmajfault] = stats.Memory.ContainerData.Pgmajfault - - // hierarchical page fault - row[colMemoryHierarchicalPgfault] = stats.Memory.HierarchicalData.Pgfault - - // hierarchical major page fault - row[colMemoryHierarchicalPgmajfault] = stats.Memory.HierarchicalData.Pgmajfault - - // Network stats. - row[colRxBytes] = stats.Network.RxBytes - row[colRxErrors] = stats.Network.RxErrors - row[colTxBytes] = stats.Network.TxBytes - row[colTxErrors] = stats.Network.TxErrors - - // TODO(jnagal): Handle per-cpu stats. - - return -} - -func (self *bigqueryStorage) containerFilesystemStatsToRows( - ref info.ContainerReference, - stats *info.ContainerStats, -) (rows []map[string]interface{}) { - for _, fsStat := range stats.Filesystem { - row := make(map[string]interface{}, 0) - row[colFsDevice] = fsStat.Device - row[colFsLimit] = fsStat.Limit - row[colFsUsage] = fsStat.Usage - rows = append(rows, row) - } - return rows -} - -func (self *bigqueryStorage) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error { - if stats == nil { - return nil - } - rows := make([]map[string]interface{}, 0) - rows = append(rows, self.containerStatsToRows(ref, stats)) - rows = append(rows, self.containerFilesystemStatsToRows(ref, stats)...) - for _, row := range rows { - err := self.client.InsertRow(row) - if err != nil { - return err - } - } - return nil -} - -func (self *bigqueryStorage) Close() error { - self.client.Close() - self.client = nil - return nil -} - -// Create a new bigquery storage driver. -// machineName: A unique identifier to identify the host that current cAdvisor -// instance is running on. -// tableName: BigQuery table used for storing stats. -func newStorage(machineName, datasetId, tableName string) (storage.StorageDriver, error) { - bqClient, err := client.NewClient() - if err != nil { - return nil, err - } - err = bqClient.CreateDataset(datasetId) - if err != nil { - return nil, err - } - - ret := &bigqueryStorage{ - client: bqClient, - machineName: machineName, - } - schema := ret.GetSchema() - err = bqClient.CreateTable(tableName, schema) - if err != nil { - return nil, err - } - return ret, nil -} diff --git a/vendor/github.com/google/cadvisor/storage/bigquery/client/client.go b/vendor/github.com/google/cadvisor/storage/bigquery/client/client.go deleted file mode 100644 index 5a040970161..00000000000 --- a/vendor/github.com/google/cadvisor/storage/bigquery/client/client.go +++ /dev/null @@ -1,233 +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 client - -import ( - "flag" - "fmt" - "io/ioutil" - "strings" - - "golang.org/x/oauth2" - "golang.org/x/oauth2/jwt" - bigquery "google.golang.org/api/bigquery/v2" -) - -var ( - // TODO(jnagal): Condense all flags to an identity file and a pem key file. - clientId = flag.String("bq_id", "", "Client ID") - clientSecret = flag.String("bq_secret", "notasecret", "Client Secret") - projectId = flag.String("bq_project_id", "", "Bigquery project ID") - serviceAccount = flag.String("bq_account", "", "Service account email") - pemFile = flag.String("bq_credentials_file", "", "Credential Key file (pem)") -) - -const ( - errAlreadyExists string = "Error 409: Already Exists" -) - -type Client struct { - service *bigquery.Service - token *oauth2.Token - datasetId string - tableId string -} - -// Helper method to create an authenticated connection. -func connect() (*oauth2.Token, *bigquery.Service, error) { - if *clientId == "" { - return nil, nil, fmt.Errorf("no client id specified") - } - if *serviceAccount == "" { - return nil, nil, fmt.Errorf("no service account specified") - } - if *projectId == "" { - return nil, nil, fmt.Errorf("no project id specified") - } - authScope := bigquery.BigqueryScope - if *pemFile == "" { - return nil, nil, fmt.Errorf("no credentials specified") - } - pemBytes, err := ioutil.ReadFile(*pemFile) - if err != nil { - return nil, nil, fmt.Errorf("could not access credential file %v - %v", pemFile, err) - } - - jwtConfig := &jwt.Config{ - Email: *serviceAccount, - Scopes: []string{authScope}, - PrivateKey: pemBytes, - TokenURL: "https://accounts.google.com/o/oauth2/token", - } - token, err := jwtConfig.TokenSource(oauth2.NoContext).Token() - if err != nil { - return nil, nil, err - } - if !token.Valid() { - return nil, nil, fmt.Errorf("invalid token for BigQuery oauth") - } - - config := &oauth2.Config{ - ClientID: *clientId, - ClientSecret: *clientSecret, - Scopes: []string{authScope}, - Endpoint: oauth2.Endpoint{ - AuthURL: "https://accounts.google.com/o/oauth2/auth", - TokenURL: "https://accounts.google.com/o/oauth2/token", - }, - } - client := config.Client(oauth2.NoContext, token) - - service, err := bigquery.New(client) - if err != nil { - fmt.Printf("Failed to create new service: %v\n", err) - return nil, nil, err - } - - return token, service, nil -} - -// Creates a new client instance with an authenticated connection to bigquery. -func NewClient() (*Client, error) { - token, service, err := connect() - if err != nil { - return nil, err - } - c := &Client{ - token: token, - service: service, - } - return c, nil -} - -func (c *Client) Close() error { - c.service = nil - return nil -} - -// Helper method to return the bigquery service connection. -// Expired connection is refreshed. -func (c *Client) getService() (*bigquery.Service, error) { - if c.token == nil || c.service == nil { - return nil, fmt.Errorf("service not initialized") - } - - // Refresh expired token. - if !c.token.Valid() { - token, service, err := connect() - if err != nil { - return nil, err - } - c.token = token - c.service = service - return service, nil - } - return c.service, nil -} - -func (c *Client) PrintDatasets() error { - datasetList, err := c.service.Datasets.List(*projectId).Do() - if err != nil { - fmt.Printf("Failed to get list of datasets\n") - return err - } else { - fmt.Printf("Successfully retrieved datasets. Retrieved: %d\n", len(datasetList.Datasets)) - } - - for _, d := range datasetList.Datasets { - fmt.Printf("%s %s\n", d.Id, d.FriendlyName) - } - return nil -} - -func (c *Client) CreateDataset(datasetId string) error { - if c.service == nil { - return fmt.Errorf("no service created") - } - _, err := c.service.Datasets.Insert(*projectId, &bigquery.Dataset{ - DatasetReference: &bigquery.DatasetReference{ - DatasetId: datasetId, - ProjectId: *projectId, - }, - }).Do() - // TODO(jnagal): Do a Get() to verify dataset already exists. - if err != nil && !strings.Contains(err.Error(), errAlreadyExists) { - return err - } - c.datasetId = datasetId - return nil -} - -// Create a table with provided table ID and schema. -// Schema is currently not updated if the table already exists. -func (c *Client) CreateTable(tableId string, schema *bigquery.TableSchema) error { - if c.service == nil || c.datasetId == "" { - return fmt.Errorf("no dataset created") - } - _, err := c.service.Tables.Get(*projectId, c.datasetId, tableId).Do() - if err != nil { - // Create a new table. - _, err := c.service.Tables.Insert(*projectId, c.datasetId, &bigquery.Table{ - Schema: schema, - TableReference: &bigquery.TableReference{ - DatasetId: c.datasetId, - ProjectId: *projectId, - TableId: tableId, - }, - }).Do() - if err != nil { - return err - } - } - // TODO(jnagal): Update schema if it has changed. We can only extend existing schema. - c.tableId = tableId - return nil -} - -// Add a row to the connected table. -func (c *Client) InsertRow(rowData map[string]interface{}) error { - service, _ := c.getService() - if service == nil || c.datasetId == "" || c.tableId == "" { - return fmt.Errorf("table not setup to add rows") - } - jsonRows := make(map[string]bigquery.JsonValue) - for key, value := range rowData { - jsonRows[key] = bigquery.JsonValue(value) - } - rows := []*bigquery.TableDataInsertAllRequestRows{ - { - Json: jsonRows, - }, - } - - // TODO(jnagal): Batch insert requests. - insertRequest := &bigquery.TableDataInsertAllRequest{Rows: rows} - - result, err := service.Tabledata.InsertAll(*projectId, c.datasetId, c.tableId, insertRequest).Do() - if err != nil { - return fmt.Errorf("error inserting row: %v", err) - } - - if len(result.InsertErrors) > 0 { - errstr := fmt.Sprintf("Insertion for %d rows failed\n", len(result.InsertErrors)) - for _, errors := range result.InsertErrors { - for _, errorproto := range errors.Errors { - errstr += fmt.Sprintf("Error inserting row %d: %+v\n", errors.Index, errorproto) - } - } - return fmt.Errorf(errstr) - } - return nil -} diff --git a/vendor/github.com/google/cadvisor/storage/bigquery/client/example/example.go b/vendor/github.com/google/cadvisor/storage/bigquery/client/example/example.go deleted file mode 100644 index f21ad0b7a65..00000000000 --- a/vendor/github.com/google/cadvisor/storage/bigquery/client/example/example.go +++ /dev/null @@ -1,87 +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 main - -import ( - "flag" - "fmt" - "time" - - "github.com/SeanDolphin/bqschema" - "github.com/google/cadvisor/storage/bigquery/client" -) - -type container struct { - Name string `json:"name"` - CpuUsage uint64 `json:"cpuusage,omitempty"` - MemoryUsage uint64 `json:"memoryusage,omitempty"` - NetworkUsage uint64 `json:"networkusage,omitempty"` - Timestamp time.Time `json:"timestamp"` -} - -func main() { - flag.Parse() - c, err := client.NewClient() - if err != nil { - fmt.Printf("Failed to connect to bigquery\n") - panic(err) - } - - c.PrintDatasets() - - // Create a new dataset. - err = c.CreateDataset("sampledataset") - if err != nil { - fmt.Printf("Failed to create dataset %v\n", err) - panic(err) - } - - // Create a new table - containerData := container{ - Name: "test_container", - CpuUsage: 123456, - MemoryUsage: 1024, - NetworkUsage: 9046, - Timestamp: time.Now(), - } - schema, err := bqschema.ToSchema(containerData) - if err != nil { - fmt.Printf("Failed to create schema") - panic(err) - } - - err = c.CreateTable("sampletable", schema) - if err != nil { - fmt.Printf("Failed to create table") - panic(err) - } - - // Add Data - m := make(map[string]interface{}) - t := time.Now() - for i := 0; i < 10; i++ { - m["Name"] = containerData.Name - m["CpuUsage"] = containerData.CpuUsage + uint64(i*100) - m["MemoryUsage"] = containerData.MemoryUsage - uint64(i*10) - m["NetworkUsage"] = containerData.NetworkUsage + uint64(i*10) - m["Timestamp"] = t.Add(time.Duration(i) * time.Second) - - err = c.InsertRow(m) - if err != nil { - fmt.Printf("Failed to insert row") - panic(err) - } - } -} diff --git a/vendor/github.com/google/cadvisor/storage/elasticsearch/elasticsearch.go b/vendor/github.com/google/cadvisor/storage/elasticsearch/elasticsearch.go deleted file mode 100644 index b43beed2546..00000000000 --- a/vendor/github.com/google/cadvisor/storage/elasticsearch/elasticsearch.go +++ /dev/null @@ -1,158 +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 elasticsearch - -import ( - "flag" - "fmt" - "os" - "sync" - "time" - - info "github.com/google/cadvisor/info/v1" - storage "github.com/google/cadvisor/storage" - - "gopkg.in/olivere/elastic.v2" -) - -func init() { - storage.RegisterStorageDriver("elasticsearch", new) -} - -type elasticStorage struct { - client *elastic.Client - machineName string - indexName string - typeName string - lock sync.Mutex -} - -type detailSpec struct { - Timestamp int64 `json:"timestamp"` - MachineName string `json:"machine_name,omitempty"` - ContainerName string `json:"container_Name,omitempty"` - ContainerStats *info.ContainerStats `json:"container_stats,omitempty"` -} - -var ( - argElasticHost = flag.String("storage_driver_es_host", "http://localhost:9200", "ElasticSearch host:port") - argIndexName = flag.String("storage_driver_es_index", "cadvisor", "ElasticSearch index name") - argTypeName = flag.String("storage_driver_es_type", "stats", "ElasticSearch type name") - argEnableSniffer = flag.Bool("storage_driver_es_enable_sniffer", false, "ElasticSearch uses a sniffing process to find all nodes of your cluster by default, automatically") -) - -func new() (storage.StorageDriver, error) { - hostname, err := os.Hostname() - if err != nil { - return nil, err - } - return newStorage( - hostname, - *argIndexName, - *argTypeName, - *argElasticHost, - *argEnableSniffer, - ) -} - -func (self *elasticStorage) containerStatsAndDefaultValues( - ref info.ContainerReference, stats *info.ContainerStats) *detailSpec { - timestamp := stats.Timestamp.UnixNano() / 1E3 - var containerName string - if len(ref.Aliases) > 0 { - containerName = ref.Aliases[0] - } else { - containerName = ref.Name - } - detail := &detailSpec{ - Timestamp: timestamp, - MachineName: self.machineName, - ContainerName: containerName, - ContainerStats: stats, - } - return detail -} - -func (self *elasticStorage) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error { - if stats == nil { - return nil - } - func() { - // AddStats will be invoked simultaneously from multiple threads and only one of them will perform a write. - self.lock.Lock() - defer self.lock.Unlock() - // Add some default params based on ContainerStats - detail := self.containerStatsAndDefaultValues(ref, stats) - // Index a cadvisor (using JSON serialization) - _, err := self.client.Index(). - Index(self.indexName). - Type(self.typeName). - BodyJson(detail). - Do() - if err != nil { - // Handle error - fmt.Printf("failed to write stats to ElasticSearch - %s", err) - return - } - }() - return nil -} - -func (self *elasticStorage) Close() error { - self.client = nil - return nil -} - -// machineName: A unique identifier to identify the host that current cAdvisor -// instance is running on. -// ElasticHost: The host which runs ElasticSearch. -func newStorage( - machineName, - indexName, - typeName, - elasticHost string, - enableSniffer bool, -) (storage.StorageDriver, error) { - // Obtain a client and connect to the default Elasticsearch installation - // on 127.0.0.1:9200. Of course you can configure your client to connect - // to other hosts and configure it in various other ways. - client, err := elastic.NewClient( - elastic.SetHealthcheck(true), - elastic.SetSniff(enableSniffer), - elastic.SetHealthcheckInterval(30*time.Second), - elastic.SetURL(elasticHost), - ) - if err != nil { - // Handle error - return nil, fmt.Errorf("failed to create the elasticsearch client - %s", err) - } - - // Ping the Elasticsearch server to get e.g. the version number - info, code, err := client.Ping().URL(elasticHost).Do() - if err != nil { - // Handle error - return nil, fmt.Errorf("failed to ping the elasticsearch - %s", err) - - } - fmt.Printf("Elasticsearch returned with code %d and version %s", code, info.Version.Number) - - ret := &elasticStorage{ - client: client, - machineName: machineName, - indexName: indexName, - typeName: typeName, - } - return ret, nil -} diff --git a/vendor/github.com/google/cadvisor/storage/influxdb/influxdb.go b/vendor/github.com/google/cadvisor/storage/influxdb/influxdb.go deleted file mode 100644 index 82739b58c2b..00000000000 --- a/vendor/github.com/google/cadvisor/storage/influxdb/influxdb.go +++ /dev/null @@ -1,369 +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 influxdb - -import ( - "fmt" - "net/url" - "os" - "sync" - "time" - - info "github.com/google/cadvisor/info/v1" - "github.com/google/cadvisor/storage" - "github.com/google/cadvisor/version" - - influxdb "github.com/influxdb/influxdb/client" -) - -func init() { - storage.RegisterStorageDriver("influxdb", new) -} - -type influxdbStorage struct { - client *influxdb.Client - machineName string - database string - retentionPolicy string - bufferDuration time.Duration - lastWrite time.Time - points []*influxdb.Point - lock sync.Mutex - readyToFlush func() bool -} - -// Series names -const ( - // Cumulative CPU usage - serCpuUsageTotal string = "cpu_usage_total" - serCpuUsageSystem string = "cpu_usage_system" - serCpuUsageUser string = "cpu_usage_user" - serCpuUsagePerCpu string = "cpu_usage_per_cpu" - // Smoothed average of number of runnable threads x 1000. - serLoadAverage string = "load_average" - // Memory Usage - serMemoryUsage string = "memory_usage" - // Working set size - serMemoryWorkingSet string = "memory_working_set" - // Cumulative count of bytes received. - serRxBytes string = "rx_bytes" - // Cumulative count of receive errors encountered. - serRxErrors string = "rx_errors" - // Cumulative count of bytes transmitted. - serTxBytes string = "tx_bytes" - // Cumulative count of transmit errors encountered. - serTxErrors string = "tx_errors" - // Filesystem device. - serFsDevice string = "fs_device" - // Filesystem limit. - serFsLimit string = "fs_limit" - // Filesystem usage. - serFsUsage string = "fs_usage" -) - -func new() (storage.StorageDriver, error) { - hostname, err := os.Hostname() - if err != nil { - return nil, err - } - return newStorage( - hostname, - *storage.ArgDbTable, - *storage.ArgDbName, - *storage.ArgDbUsername, - *storage.ArgDbPassword, - *storage.ArgDbHost, - *storage.ArgDbIsSecure, - *storage.ArgDbBufferDuration, - ) -} - -// Field names -const ( - fieldValue string = "value" - fieldType string = "type" - fieldDevice string = "device" -) - -// Tag names -const ( - tagMachineName string = "machine" - tagContainerName string = "container_name" -) - -func (self *influxdbStorage) containerFilesystemStatsToPoints( - ref info.ContainerReference, - stats *info.ContainerStats) (points []*influxdb.Point) { - if len(stats.Filesystem) == 0 { - return points - } - for _, fsStat := range stats.Filesystem { - tagsFsUsage := map[string]string{ - fieldDevice: fsStat.Device, - fieldType: "usage", - } - fieldsFsUsage := map[string]interface{}{ - fieldValue: int64(fsStat.Usage), - } - pointFsUsage := &influxdb.Point{ - Measurement: serFsUsage, - Tags: tagsFsUsage, - Fields: fieldsFsUsage, - } - - tagsFsLimit := map[string]string{ - fieldDevice: fsStat.Device, - fieldType: "limit", - } - fieldsFsLimit := map[string]interface{}{ - fieldValue: int64(fsStat.Limit), - } - pointFsLimit := &influxdb.Point{ - Measurement: serFsLimit, - Tags: tagsFsLimit, - Fields: fieldsFsLimit, - } - - points = append(points, pointFsUsage, pointFsLimit) - } - - self.tagPoints(ref, stats, points) - - return points -} - -// Set tags and timestamp for all points of the batch. -// Points should inherit the tags that are set for BatchPoints, but that does not seem to work. -func (self *influxdbStorage) tagPoints(ref info.ContainerReference, stats *info.ContainerStats, points []*influxdb.Point) { - // Use container alias if possible - var containerName string - if len(ref.Aliases) > 0 { - containerName = ref.Aliases[0] - } else { - containerName = ref.Name - } - - commonTags := map[string]string{ - tagMachineName: self.machineName, - tagContainerName: containerName, - } - for i := 0; i < len(points); i++ { - // merge with existing tags if any - addTagsToPoint(points[i], commonTags) - points[i].Time = stats.Timestamp - } -} - -func (self *influxdbStorage) containerStatsToPoints( - ref info.ContainerReference, - stats *info.ContainerStats, -) (points []*influxdb.Point) { - // CPU usage: Total usage in nanoseconds - points = append(points, makePoint(serCpuUsageTotal, stats.Cpu.Usage.Total)) - - // CPU usage: Time spend in system space (in nanoseconds) - points = append(points, makePoint(serCpuUsageSystem, stats.Cpu.Usage.System)) - - // CPU usage: Time spent in user space (in nanoseconds) - points = append(points, makePoint(serCpuUsageUser, stats.Cpu.Usage.User)) - - // CPU usage per CPU - for i := 0; i < len(stats.Cpu.Usage.PerCpu); i++ { - point := makePoint(serCpuUsagePerCpu, stats.Cpu.Usage.PerCpu[i]) - tags := map[string]string{"instance": fmt.Sprintf("%v", i)} - addTagsToPoint(point, tags) - - points = append(points, point) - } - - // Load Average - points = append(points, makePoint(serLoadAverage, stats.Cpu.LoadAverage)) - - // Memory Usage - points = append(points, makePoint(serMemoryUsage, stats.Memory.Usage)) - - // Working Set Size - points = append(points, makePoint(serMemoryWorkingSet, stats.Memory.WorkingSet)) - - // Network Stats - points = append(points, makePoint(serRxBytes, stats.Network.RxBytes)) - points = append(points, makePoint(serRxErrors, stats.Network.RxErrors)) - points = append(points, makePoint(serTxBytes, stats.Network.TxBytes)) - points = append(points, makePoint(serTxErrors, stats.Network.TxErrors)) - - self.tagPoints(ref, stats, points) - - return points -} - -func (self *influxdbStorage) OverrideReadyToFlush(readyToFlush func() bool) { - self.readyToFlush = readyToFlush -} - -func (self *influxdbStorage) defaultReadyToFlush() bool { - return time.Since(self.lastWrite) >= self.bufferDuration -} - -func (self *influxdbStorage) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error { - if stats == nil { - return nil - } - var pointsToFlush []*influxdb.Point - func() { - // AddStats will be invoked simultaneously from multiple threads and only one of them will perform a write. - self.lock.Lock() - defer self.lock.Unlock() - - self.points = append(self.points, self.containerStatsToPoints(ref, stats)...) - self.points = append(self.points, self.containerFilesystemStatsToPoints(ref, stats)...) - if self.readyToFlush() { - pointsToFlush = self.points - self.points = make([]*influxdb.Point, 0) - self.lastWrite = time.Now() - } - }() - if len(pointsToFlush) > 0 { - points := make([]influxdb.Point, len(pointsToFlush)) - for i, p := range pointsToFlush { - points[i] = *p - } - - batchTags := map[string]string{tagMachineName: self.machineName} - bp := influxdb.BatchPoints{ - Points: points, - Database: self.database, - Tags: batchTags, - Time: stats.Timestamp, - } - response, err := self.client.Write(bp) - if err != nil || checkResponseForErrors(response) != nil { - return fmt.Errorf("failed to write stats to influxDb - %s", err) - } - } - return nil -} - -func (self *influxdbStorage) Close() error { - self.client = nil - return nil -} - -// machineName: A unique identifier to identify the host that current cAdvisor -// instance is running on. -// influxdbHost: The host which runs influxdb (host:port) -func newStorage( - machineName, - tablename, - database, - username, - password, - influxdbHost string, - isSecure bool, - bufferDuration time.Duration, -) (*influxdbStorage, error) { - url := &url.URL{ - Scheme: "http", - Host: influxdbHost, - } - if isSecure { - url.Scheme = "https" - } - - config := &influxdb.Config{ - URL: *url, - Username: username, - Password: password, - UserAgent: fmt.Sprintf("%v/%v", "cAdvisor", version.Info["version"]), - } - client, err := influxdb.NewClient(*config) - if err != nil { - return nil, err - } - - ret := &influxdbStorage{ - client: client, - machineName: machineName, - database: database, - bufferDuration: bufferDuration, - lastWrite: time.Now(), - points: make([]*influxdb.Point, 0), - } - ret.readyToFlush = ret.defaultReadyToFlush - return ret, nil -} - -// Creates a measurement point with a single value field -func makePoint(name string, value interface{}) *influxdb.Point { - fields := map[string]interface{}{ - fieldValue: toSignedIfUnsigned(value), - } - - return &influxdb.Point{ - Measurement: name, - Fields: fields, - } -} - -// Adds additional tags to the existing tags of a point -func addTagsToPoint(point *influxdb.Point, tags map[string]string) { - if point.Tags == nil { - point.Tags = tags - } else { - for k, v := range tags { - point.Tags[k] = v - } - } -} - -// Checks response for possible errors -func checkResponseForErrors(response *influxdb.Response) error { - const msg = "failed to write stats to influxDb - %s" - - if response != nil && response.Err != nil { - return fmt.Errorf(msg, response.Err) - } - if response != nil && response.Results != nil { - for _, result := range response.Results { - if result.Err != nil { - return fmt.Errorf(msg, result.Err) - } - if result.Series != nil { - for _, row := range result.Series { - if row.Err != nil { - return fmt.Errorf(msg, row.Err) - } - } - } - } - } - return nil -} - -// Some stats have type unsigned integer, but the InfluxDB client accepts only signed integers. -func toSignedIfUnsigned(value interface{}) interface{} { - switch v := value.(type) { - case uint64: - return int64(v) - case uint32: - return int32(v) - case uint16: - return int16(v) - case uint8: - return int8(v) - case uint: - return int(v) - } - return value -} diff --git a/vendor/github.com/google/cadvisor/storage/kafka/kafka.go b/vendor/github.com/google/cadvisor/storage/kafka/kafka.go deleted file mode 100644 index e43a374c81d..00000000000 --- a/vendor/github.com/google/cadvisor/storage/kafka/kafka.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2016 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 kafka - -import ( - "encoding/json" - "flag" - "os" - "strings" - "time" - - info "github.com/google/cadvisor/info/v1" - "github.com/google/cadvisor/storage" - "github.com/google/cadvisor/utils/container" - - kafka "github.com/Shopify/sarama" - "github.com/golang/glog" -) - -func init() { - storage.RegisterStorageDriver("kafka", new) -} - -var ( - brokers = flag.String("storage_driver_kafka_broker_list", "localhost:9092", "kafka broker(s) csv") - topic = flag.String("storage_driver_kafka_topic", "stats", "kafka topic") -) - -type kafkaStorage struct { - producer kafka.AsyncProducer - topic string - machineName string -} - -type detailSpec struct { - Timestamp time.Time `json:"timestamp"` - MachineName string `json:"machine_name,omitempty"` - ContainerName string `json:"container_Name,omitempty"` - ContainerID string `json:"container_Id,omitempty"` - ContainerLabels map[string]string `json:"container_labels,omitempty"` - ContainerStats *info.ContainerStats `json:"container_stats,omitempty"` -} - -func (driver *kafkaStorage) infoToDetailSpec(ref info.ContainerReference, stats *info.ContainerStats) *detailSpec { - timestamp := time.Now() - containerID := ref.Id - containerLabels := ref.Labels - containerName := container.GetPreferredName(ref) - - detail := &detailSpec{ - Timestamp: timestamp, - MachineName: driver.machineName, - ContainerName: containerName, - ContainerID: containerID, - ContainerLabels: containerLabels, - ContainerStats: stats, - } - return detail -} - -func (driver *kafkaStorage) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error { - detail := driver.infoToDetailSpec(ref, stats) - b, err := json.Marshal(detail) - - driver.producer.Input() <- &kafka.ProducerMessage{ - Topic: driver.topic, - Value: kafka.StringEncoder(b), - } - - return err -} - -func (self *kafkaStorage) Close() error { - return self.producer.Close() -} - -func new() (storage.StorageDriver, error) { - machineName, err := os.Hostname() - if err != nil { - return nil, err - } - return newStorage(machineName) -} - -func newStorage(machineName string) (storage.StorageDriver, error) { - config := kafka.NewConfig() - config.Producer.RequiredAcks = kafka.WaitForAll - - brokerList := strings.Split(*brokers, ",") - glog.V(4).Infof("Kafka brokers:%q", brokers) - - producer, err := kafka.NewAsyncProducer(brokerList, config) - if err != nil { - return nil, err - } - ret := &kafkaStorage{ - producer: producer, - topic: *topic, - machineName: machineName, - } - return ret, nil -} diff --git a/vendor/github.com/google/cadvisor/storage/redis/redis.go b/vendor/github.com/google/cadvisor/storage/redis/redis.go deleted file mode 100644 index 44f7e3428a2..00000000000 --- a/vendor/github.com/google/cadvisor/storage/redis/redis.go +++ /dev/null @@ -1,139 +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 redis - -import ( - "encoding/json" - "os" - "sync" - "time" - - info "github.com/google/cadvisor/info/v1" - storage "github.com/google/cadvisor/storage" - - redis "github.com/garyburd/redigo/redis" -) - -func init() { - storage.RegisterStorageDriver("redis", new) -} - -type redisStorage struct { - conn redis.Conn - machineName string - redisKey string - bufferDuration time.Duration - lastWrite time.Time - lock sync.Mutex - readyToFlush func() bool -} - -type detailSpec struct { - Timestamp int64 `json:"timestamp"` - MachineName string `json:"machine_name,omitempty"` - ContainerName string `json:"container_Name,omitempty"` - ContainerStats *info.ContainerStats `json:"container_stats,omitempty"` -} - -func new() (storage.StorageDriver, error) { - hostname, err := os.Hostname() - if err != nil { - return nil, err - } - return newStorage( - hostname, - *storage.ArgDbName, - *storage.ArgDbHost, - *storage.ArgDbBufferDuration, - ) -} - -func (self *redisStorage) defaultReadyToFlush() bool { - return time.Since(self.lastWrite) >= self.bufferDuration -} - -//We must add some default params (for example: MachineName,ContainerName...)because containerStats do not include them -func (self *redisStorage) containerStatsAndDefaultValues(ref info.ContainerReference, stats *info.ContainerStats) *detailSpec { - timestamp := stats.Timestamp.UnixNano() / 1E3 - var containerName string - if len(ref.Aliases) > 0 { - containerName = ref.Aliases[0] - } else { - containerName = ref.Name - } - detail := &detailSpec{ - Timestamp: timestamp, - MachineName: self.machineName, - ContainerName: containerName, - ContainerStats: stats, - } - return detail -} - -//Push the data into redis -func (self *redisStorage) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error { - if stats == nil { - return nil - } - var seriesToFlush []byte - func() { - // AddStats will be invoked simultaneously from multiple threads and only one of them will perform a write. - self.lock.Lock() - defer self.lock.Unlock() - // Add some default params based on containerStats - detail := self.containerStatsAndDefaultValues(ref, stats) - //To json - b, _ := json.Marshal(detail) - if self.readyToFlush() { - seriesToFlush = b - self.lastWrite = time.Now() - } - }() - if len(seriesToFlush) > 0 { - //We use redis's "LPUSH" to push the data to the redis - self.conn.Send("LPUSH", self.redisKey, seriesToFlush) - } - return nil -} - -func (self *redisStorage) Close() error { - return self.conn.Close() -} - -// Create a new redis storage driver. -// machineName: A unique identifier to identify the host that runs the current cAdvisor -// instance is running on. -// redisHost: The host which runs redis. -// redisKey: The key for the Data that stored in the redis -func newStorage( - machineName, - redisKey, - redisHost string, - bufferDuration time.Duration, -) (storage.StorageDriver, error) { - conn, err := redis.Dial("tcp", redisHost) - if err != nil { - return nil, err - } - ret := &redisStorage{ - conn: conn, - machineName: machineName, - redisKey: redisKey, - bufferDuration: bufferDuration, - lastWrite: time.Now(), - } - ret.readyToFlush = ret.defaultReadyToFlush - return ret, nil -} diff --git a/vendor/github.com/google/cadvisor/storage/statsd/client/client.go b/vendor/github.com/google/cadvisor/storage/statsd/client/client.go deleted file mode 100644 index 958468ad554..00000000000 --- a/vendor/github.com/google/cadvisor/storage/statsd/client/client.go +++ /dev/null @@ -1,64 +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 client - -import ( - "fmt" - "net" - - "github.com/golang/glog" -) - -type Client struct { - HostPort string - Namespace string - conn net.Conn -} - -func (self *Client) Open() error { - conn, err := net.Dial("udp", self.HostPort) - if err != nil { - glog.Errorf("failed to open udp connection to %q: %v", self.HostPort, err) - return err - } - self.conn = conn - return nil -} - -func (self *Client) Close() error { - self.conn.Close() - self.conn = nil - return nil -} - -// Simple send to statsd daemon without sampling. -func (self *Client) Send(namespace, containerName, key string, value uint64) error { - // only send counter value - formatted := fmt.Sprintf("%s.%s.%s:%d|g", namespace, containerName, key, value) - _, err := fmt.Fprintf(self.conn, formatted) - if err != nil { - glog.V(3).Infof("failed to send data %q: %v", formatted, err) - return err - } - return nil -} - -func New(hostPort string) (*Client, error) { - Client := Client{HostPort: hostPort} - if err := Client.Open(); err != nil { - return nil, err - } - return &Client, nil -} diff --git a/vendor/github.com/google/cadvisor/storage/statsd/statsd.go b/vendor/github.com/google/cadvisor/storage/statsd/statsd.go deleted file mode 100644 index 0b571dcf811..00000000000 --- a/vendor/github.com/google/cadvisor/storage/statsd/statsd.go +++ /dev/null @@ -1,136 +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 statsd - -import ( - info "github.com/google/cadvisor/info/v1" - "github.com/google/cadvisor/storage" - client "github.com/google/cadvisor/storage/statsd/client" -) - -func init() { - storage.RegisterStorageDriver("statsd", new) -} - -type statsdStorage struct { - client *client.Client - Namespace string -} - -const ( - colCpuCumulativeUsage string = "cpu_cumulative_usage" - // Memory Usage - colMemoryUsage string = "memory_usage" - // Working set size - colMemoryWorkingSet string = "memory_working_set" - // Cumulative count of bytes received. - colRxBytes string = "rx_bytes" - // Cumulative count of receive errors encountered. - colRxErrors string = "rx_errors" - // Cumulative count of bytes transmitted. - colTxBytes string = "tx_bytes" - // Cumulative count of transmit errors encountered. - colTxErrors string = "tx_errors" - // Filesystem summary - colFsSummary = "fs_summary" - // Filesystem limit. - colFsLimit = "fs_limit" - // Filesystem usage. - colFsUsage = "fs_usage" -) - -func new() (storage.StorageDriver, error) { - return newStorage(*storage.ArgDbName, *storage.ArgDbHost) -} - -func (self *statsdStorage) containerStatsToValues( - stats *info.ContainerStats, -) (series map[string]uint64) { - series = make(map[string]uint64) - - // Cumulative Cpu Usage - series[colCpuCumulativeUsage] = stats.Cpu.Usage.Total - - // Memory Usage - series[colMemoryUsage] = stats.Memory.Usage - - // Working set size - series[colMemoryWorkingSet] = stats.Memory.WorkingSet - - // Network stats. - series[colRxBytes] = stats.Network.RxBytes - series[colRxErrors] = stats.Network.RxErrors - series[colTxBytes] = stats.Network.TxBytes - series[colTxErrors] = stats.Network.TxErrors - - return series -} - -func (self *statsdStorage) containerFsStatsToValues( - series *map[string]uint64, - stats *info.ContainerStats, -) { - for _, fsStat := range stats.Filesystem { - // Summary stats. - (*series)[colFsSummary+"."+colFsLimit] += fsStat.Limit - (*series)[colFsSummary+"."+colFsUsage] += fsStat.Usage - - // Per device stats. - (*series)[fsStat.Device+"."+colFsLimit] = fsStat.Limit - (*series)[fsStat.Device+"."+colFsUsage] = fsStat.Usage - } -} - -//Push the data into redis -func (self *statsdStorage) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error { - if stats == nil { - return nil - } - - var containerName string - if len(ref.Aliases) > 0 { - containerName = ref.Aliases[0] - } else { - containerName = ref.Name - } - - series := self.containerStatsToValues(stats) - self.containerFsStatsToValues(&series, stats) - for key, value := range series { - err := self.client.Send(self.Namespace, containerName, key, value) - if err != nil { - return err - } - } - return nil -} - -func (self *statsdStorage) Close() error { - self.client.Close() - self.client = nil - return nil -} - -func newStorage(namespace, hostPort string) (*statsdStorage, error) { - statsdClient, err := client.New(hostPort) - if err != nil { - return nil, err - } - statsdStorage := &statsdStorage{ - client: statsdClient, - Namespace: namespace, - } - return statsdStorage, nil -} diff --git a/vendor/github.com/google/cadvisor/storage/stdout/stdout.go b/vendor/github.com/google/cadvisor/storage/stdout/stdout.go deleted file mode 100644 index aa8aafe9bf5..00000000000 --- a/vendor/github.com/google/cadvisor/storage/stdout/stdout.go +++ /dev/null @@ -1,125 +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 stdout - -import ( - "bytes" - "fmt" - - info "github.com/google/cadvisor/info/v1" - "github.com/google/cadvisor/storage" -) - -func init() { - storage.RegisterStorageDriver("stdout", new) -} - -type stdoutStorage struct { - Namespace string -} - -const ( - colCpuCumulativeUsage = "cpu_cumulative_usage" - // Memory Usage - colMemoryUsage = "memory_usage" - // Working set size - colMemoryWorkingSet = "memory_working_set" - // Cumulative count of bytes received. - colRxBytes = "rx_bytes" - // Cumulative count of receive errors encountered. - colRxErrors = "rx_errors" - // Cumulative count of bytes transmitted. - colTxBytes = "tx_bytes" - // Cumulative count of transmit errors encountered. - colTxErrors = "tx_errors" - // Filesystem summary - colFsSummary = "fs_summary" - // Filesystem limit. - colFsLimit = "fs_limit" - // Filesystem usage. - colFsUsage = "fs_usage" -) - -func new() (storage.StorageDriver, error) { - return newStorage(*storage.ArgDbHost) -} - -func (driver *stdoutStorage) containerStatsToValues(stats *info.ContainerStats) (series map[string]uint64) { - series = make(map[string]uint64) - - // Cumulative Cpu Usage - series[colCpuCumulativeUsage] = stats.Cpu.Usage.Total - - // Memory Usage - series[colMemoryUsage] = stats.Memory.Usage - - // Working set size - series[colMemoryWorkingSet] = stats.Memory.WorkingSet - - // Network stats. - series[colRxBytes] = stats.Network.RxBytes - series[colRxErrors] = stats.Network.RxErrors - series[colTxBytes] = stats.Network.TxBytes - series[colTxErrors] = stats.Network.TxErrors - - return series -} - -func (driver *stdoutStorage) containerFsStatsToValues(series *map[string]uint64, stats *info.ContainerStats) { - for _, fsStat := range stats.Filesystem { - // Summary stats. - (*series)[colFsSummary+"."+colFsLimit] += fsStat.Limit - (*series)[colFsSummary+"."+colFsUsage] += fsStat.Usage - - // Per device stats. - (*series)[fsStat.Device+"."+colFsLimit] = fsStat.Limit - (*series)[fsStat.Device+"."+colFsUsage] = fsStat.Usage - } -} - -func (driver *stdoutStorage) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error { - if stats == nil { - return nil - } - - containerName := ref.Name - if len(ref.Aliases) > 0 { - containerName = ref.Aliases[0] - } - - var buffer bytes.Buffer - buffer.WriteString(fmt.Sprintf("cName=%s host=%s", containerName, driver.Namespace)) - - series := driver.containerStatsToValues(stats) - driver.containerFsStatsToValues(&series, stats) - for key, value := range series { - buffer.WriteString(fmt.Sprintf(" %s=%v", key, value)) - } - - _, err := fmt.Println(buffer.String()) - - return err -} - -func (driver *stdoutStorage) Close() error { - return nil -} - -func newStorage(namespace string) (*stdoutStorage, error) { - stdoutStorage := &stdoutStorage{ - Namespace: namespace, - } - return stdoutStorage, nil -} diff --git a/vendor/github.com/google/cadvisor/storage/test/mock.go b/vendor/github.com/google/cadvisor/storage/test/mock.go deleted file mode 100644 index 78e778671bf..00000000000 --- a/vendor/github.com/google/cadvisor/storage/test/mock.go +++ /dev/null @@ -1,39 +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 test - -import ( - info "github.com/google/cadvisor/info/v1" - - "github.com/stretchr/testify/mock" -) - -type MockStorageDriver struct { - mock.Mock - MockCloseMethod bool -} - -func (self *MockStorageDriver) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error { - args := self.Called(ref, stats) - return args.Error(0) -} - -func (self *MockStorageDriver) Close() error { - if self.MockCloseMethod { - args := self.Called() - return args.Error(0) - } - return nil -} diff --git a/vendor/github.com/google/cadvisor/storage/test/storagetests.go b/vendor/github.com/google/cadvisor/storage/test/storagetests.go deleted file mode 100644 index f9162833656..00000000000 --- a/vendor/github.com/google/cadvisor/storage/test/storagetests.go +++ /dev/null @@ -1,138 +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 test - -import ( - "math/rand" - "reflect" - "testing" - "time" - - info "github.com/google/cadvisor/info/v1" - "github.com/google/cadvisor/storage" -) - -type TestStorageDriver interface { - StatsEq(a *info.ContainerStats, b *info.ContainerStats) bool - storage.StorageDriver -} - -func buildTrace(cpu, mem []uint64, duration time.Duration) []*info.ContainerStats { - if len(cpu) != len(mem) { - panic("len(cpu) != len(mem)") - } - - ret := make([]*info.ContainerStats, len(cpu)) - currentTime := time.Now() - - var cpuTotalUsage uint64 = 0 - for i, cpuUsage := range cpu { - cpuTotalUsage += cpuUsage - stats := new(info.ContainerStats) - stats.Timestamp = currentTime - currentTime = currentTime.Add(duration) - - stats.Cpu.Usage.Total = cpuTotalUsage - stats.Cpu.Usage.User = stats.Cpu.Usage.Total - stats.Cpu.Usage.System = 0 - stats.Cpu.Usage.PerCpu = []uint64{cpuTotalUsage} - - stats.Memory.Usage = mem[i] - - stats.Network.RxBytes = uint64(rand.Intn(10000)) - stats.Network.RxErrors = uint64(rand.Intn(1000)) - stats.Network.TxBytes = uint64(rand.Intn(100000)) - stats.Network.TxErrors = uint64(rand.Intn(1000)) - - stats.Filesystem = make([]info.FsStats, 1) - stats.Filesystem[0].Device = "/dev/sda1" - stats.Filesystem[0].Limit = 1024000000 - stats.Filesystem[0].Usage = 1024000 - ret[i] = stats - } - return ret -} - -func TimeEq(t1, t2 time.Time, tolerance time.Duration) bool { - // t1 should not be later than t2 - if t1.After(t2) { - t1, t2 = t2, t1 - } - diff := t2.Sub(t1) - if diff <= tolerance { - return true - } - return false -} - -const ( - // 10ms, i.e. 0.01s - timePrecision time.Duration = 10 * time.Millisecond -) - -// This function is useful because we do not require precise time -// representation. -func DefaultStatsEq(a, b *info.ContainerStats) bool { - if !TimeEq(a.Timestamp, b.Timestamp, timePrecision) { - return false - } - if !reflect.DeepEqual(a.Cpu, b.Cpu) { - return false - } - if !reflect.DeepEqual(a.Memory, b.Memory) { - return false - } - if !reflect.DeepEqual(a.Network, b.Network) { - return false - } - if !reflect.DeepEqual(a.Filesystem, b.Filesystem) { - return false - } - - return true -} - -// This function will generate random stats and write -// them into the storage. The function will not close the driver -func StorageDriverFillRandomStatsFunc( - containerName string, - N int, - driver TestStorageDriver, - t *testing.T, -) { - cpuTrace := make([]uint64, 0, N) - memTrace := make([]uint64, 0, N) - - // We need N+1 observations to get N samples - for i := 0; i < N+1; i++ { - cpuTrace = append(cpuTrace, uint64(rand.Intn(1000))) - memTrace = append(memTrace, uint64(rand.Intn(1000))) - } - - samplePeriod := 1 * time.Second - - ref := info.ContainerReference{ - Name: containerName, - } - - trace := buildTrace(cpuTrace, memTrace, samplePeriod) - - for _, stats := range trace { - err := driver.AddStats(ref, stats) - if err != nil { - t.Fatalf("unable to add stats: %v", err) - } - } -} diff --git a/vendor/github.com/google/cadvisor/utils/container/container.go b/vendor/github.com/google/cadvisor/utils/container/container.go deleted file mode 100644 index ea956a5c6e9..00000000000 --- a/vendor/github.com/google/cadvisor/utils/container/container.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 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 container - -import ( - info "github.com/google/cadvisor/info/v1" -) - -// Returns the alias a container is known by within a certain namespace, -// if available. Otherwise returns the absolute name of the container. -func GetPreferredName(ref info.ContainerReference) string { - var containerName string - if len(ref.Aliases) > 0 { - containerName = ref.Aliases[0] - } else { - containerName = ref.Name - } - return containerName -} diff --git a/vendor/github.com/google/cadvisor/utils/cpuload/netlink/example/example.go b/vendor/github.com/google/cadvisor/utils/cpuload/netlink/example/example.go deleted file mode 100644 index 42e60862e3c..00000000000 --- a/vendor/github.com/google/cadvisor/utils/cpuload/netlink/example/example.go +++ /dev/null @@ -1,40 +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 main - -import ( - "log" - - "github.com/google/cadvisor/utils/cpuload/netlink" -) - -func main() { - n, err := netlink.New() - if err != nil { - log.Printf("Failed to create cpu load util: %s", err) - return - } - defer n.Stop() - - paths := []string{"/sys/fs/cgroup/cpu", "/sys/fs/cgroup/cpu/docker"} - names := []string{"/", "/docker"} - for i, path := range paths { - stats, err := n.GetCpuLoad(names[i], path) - if err != nil { - log.Printf("Error getting cpu load for %q: %s", path, err) - } - log.Printf("Task load for %s: %+v", path, stats) - } -} diff --git a/vendor/github.com/google/cadvisor/utils/oomparser/oomexample/main.go b/vendor/github.com/google/cadvisor/utils/oomparser/oomexample/main.go deleted file mode 100644 index 8667d3285e2..00000000000 --- a/vendor/github.com/google/cadvisor/utils/oomparser/oomexample/main.go +++ /dev/null @@ -1,41 +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 main - -import ( - "flag" - - "github.com/golang/glog" - "github.com/google/cadvisor/utils/oomparser" -) - -// demonstrates how to run oomparser.OomParser to get OomInstance information -func main() { - flag.Parse() - // out is a user-provided channel from which the user can read incoming - // OomInstance objects - outStream := make(chan *oomparser.OomInstance) - oomLog, err := oomparser.New() - if err != nil { - glog.Infof("Couldn't make a new oomparser. %v", err) - } else { - go oomLog.StreamOoms(outStream) - // demonstration of how to get oomLog's list of oomInstances or access - // the user-declared oomInstance channel, here called outStream - for oomInstance := range outStream { - glog.Infof("Reading the buffer. Output is %v", oomInstance) - } - } -} diff --git a/vendor/github.com/google/cadvisor/utils/procfs/doc.go b/vendor/github.com/google/cadvisor/utils/procfs/doc.go deleted file mode 100644 index 763a556c553..00000000000 --- a/vendor/github.com/google/cadvisor/utils/procfs/doc.go +++ /dev/null @@ -1,17 +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. - -// procfs contains several low level functions to read information from /proc -// filesystem, and also provides some utility functions like JiffiesToDuration. -package procfs diff --git a/vendor/github.com/google/cadvisor/utils/procfs/jiffy.go b/vendor/github.com/google/cadvisor/utils/procfs/jiffy.go deleted file mode 100644 index b36772a2525..00000000000 --- a/vendor/github.com/google/cadvisor/utils/procfs/jiffy.go +++ /dev/null @@ -1,33 +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 procfs - -/* -#include -*/ -import "C" -import "time" - -var userHz uint64 - -func init() { - userHzLong := C.sysconf(C._SC_CLK_TCK) - userHz = uint64(userHzLong) -} - -func JiffiesToDuration(jiffies uint64) time.Duration { - d := jiffies * 1000000000 / userHz - return time.Duration(d) -} diff --git a/vendor/github.com/google/cadvisor/utils/sysfs/fakesysfs/fake.go b/vendor/github.com/google/cadvisor/utils/sysfs/fakesysfs/fake.go deleted file mode 100644 index 963fc61eff8..00000000000 --- a/vendor/github.com/google/cadvisor/utils/sysfs/fakesysfs/fake.go +++ /dev/null @@ -1,114 +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 fakesysfs - -import ( - "os" - "time" - - "github.com/google/cadvisor/utils/sysfs" -) - -// If we extend sysfs to support more interfaces, it might be worth making this a mock instead of a fake. -type FileInfo struct { - EntryName string -} - -func (self *FileInfo) Name() string { - return self.EntryName -} - -func (self *FileInfo) Size() int64 { - return 1234567 -} - -func (self *FileInfo) Mode() os.FileMode { - return 0 -} - -func (self *FileInfo) ModTime() time.Time { - return time.Time{} -} - -func (self *FileInfo) IsDir() bool { - return true -} - -func (self *FileInfo) Sys() interface{} { - return nil -} - -type FakeSysFs struct { - info FileInfo - cache sysfs.CacheInfo -} - -func (self *FakeSysFs) GetBlockDevices() ([]os.FileInfo, error) { - self.info.EntryName = "sda" - return []os.FileInfo{&self.info}, nil -} - -func (self *FakeSysFs) GetBlockDeviceSize(name string) (string, error) { - return "1234567", nil -} - -func (self *FakeSysFs) GetBlockDeviceScheduler(name string) (string, error) { - return "noop deadline [cfq]", nil -} - -func (self *FakeSysFs) GetBlockDeviceNumbers(name string) (string, error) { - return "8:0\n", nil -} - -func (self *FakeSysFs) GetNetworkDevices() ([]os.FileInfo, error) { - return []os.FileInfo{&self.info}, nil -} - -func (self *FakeSysFs) GetNetworkAddress(name string) (string, error) { - return "42:01:02:03:04:f4\n", nil -} - -func (self *FakeSysFs) GetNetworkMtu(name string) (string, error) { - return "1024\n", nil -} - -func (self *FakeSysFs) GetNetworkSpeed(name string) (string, error) { - return "1000\n", nil -} - -func (self *FakeSysFs) GetNetworkStatValue(name string, stat string) (uint64, error) { - return 1024, nil -} - -func (self *FakeSysFs) GetCaches(id int) ([]os.FileInfo, error) { - self.info.EntryName = "index0" - return []os.FileInfo{&self.info}, nil -} - -func (self *FakeSysFs) GetCacheInfo(cpu int, cache string) (sysfs.CacheInfo, error) { - return self.cache, nil -} - -func (self *FakeSysFs) SetCacheInfo(cache sysfs.CacheInfo) { - self.cache = cache -} - -func (self *FakeSysFs) SetEntryName(name string) { - self.info.EntryName = name -} - -func (self *FakeSysFs) GetSystemUUID() (string, error) { - return "1F862619-BA9F-4526-8F85-ECEAF0C97430", nil -} diff --git a/vendor/github.com/hashicorp/raft/bench/bench.go b/vendor/github.com/hashicorp/raft/bench/bench.go deleted file mode 100644 index d7a58f45f44..00000000000 --- a/vendor/github.com/hashicorp/raft/bench/bench.go +++ /dev/null @@ -1,171 +0,0 @@ -package raftbench - -// raftbench provides common benchmarking functions which can be used by -// anything which implements the raft.LogStore and raft.StableStore interfaces. -// All functions accept these interfaces and perform benchmarking. This -// makes comparing backend performance easier by sharing the tests. - -import ( - "github.com/hashicorp/raft" - "testing" -) - -func FirstIndex(b *testing.B, store raft.LogStore) { - // Create some fake data - var logs []*raft.Log - for i := 1; i < 10; i++ { - logs = append(logs, &raft.Log{Index: uint64(i), Data: []byte("data")}) - } - if err := store.StoreLogs(logs); err != nil { - b.Fatalf("err: %s", err) - } - b.ResetTimer() - - // Run FirstIndex a number of times - for n := 0; n < b.N; n++ { - store.FirstIndex() - } -} - -func LastIndex(b *testing.B, store raft.LogStore) { - // Create some fake data - var logs []*raft.Log - for i := 1; i < 10; i++ { - logs = append(logs, &raft.Log{Index: uint64(i), Data: []byte("data")}) - } - if err := store.StoreLogs(logs); err != nil { - b.Fatalf("err: %s", err) - } - b.ResetTimer() - - // Run LastIndex a number of times - for n := 0; n < b.N; n++ { - store.LastIndex() - } -} - -func GetLog(b *testing.B, store raft.LogStore) { - // Create some fake data - var logs []*raft.Log - for i := 1; i < 10; i++ { - logs = append(logs, &raft.Log{Index: uint64(i), Data: []byte("data")}) - } - if err := store.StoreLogs(logs); err != nil { - b.Fatalf("err: %s", err) - } - b.ResetTimer() - - // Run GetLog a number of times - for n := 0; n < b.N; n++ { - if err := store.GetLog(5, new(raft.Log)); err != nil { - b.Fatalf("err: %s", err) - } - } -} - -func StoreLog(b *testing.B, store raft.LogStore) { - // Run StoreLog a number of times - for n := 0; n < b.N; n++ { - log := &raft.Log{Index: uint64(n), Data: []byte("data")} - if err := store.StoreLog(log); err != nil { - b.Fatalf("err: %s", err) - } - } -} - -func StoreLogs(b *testing.B, store raft.LogStore) { - // Run StoreLogs a number of times. We want to set multiple logs each - // run, so we create 3 logs with incrementing indexes for each iteration. - for n := 0; n < b.N; n++ { - b.StopTimer() - offset := 3 * (n + 1) - logs := []*raft.Log{ - &raft.Log{Index: uint64(offset - 2), Data: []byte("data")}, - &raft.Log{Index: uint64(offset - 1), Data: []byte("data")}, - &raft.Log{Index: uint64(offset), Data: []byte("data")}, - } - b.StartTimer() - - if err := store.StoreLogs(logs); err != nil { - b.Fatalf("err: %s", err) - } - } -} - -func DeleteRange(b *testing.B, store raft.LogStore) { - // Create some fake data. In this case, we create 3 new log entries for each - // test case, and separate them by index in multiples of 10. This allows - // some room so that we can test deleting ranges with "extra" logs to - // to ensure we stop going to the database once our max index is hit. - var logs []*raft.Log - for n := 0; n < b.N; n++ { - offset := 10 * n - for i := offset; i < offset+3; i++ { - logs = append(logs, &raft.Log{Index: uint64(i), Data: []byte("data")}) - } - } - if err := store.StoreLogs(logs); err != nil { - b.Fatalf("err: %s", err) - } - b.ResetTimer() - - // Delete a range of the data - for n := 0; n < b.N; n++ { - offset := 10 * n - if err := store.DeleteRange(uint64(offset), uint64(offset+9)); err != nil { - b.Fatalf("err: %s", err) - } - } -} - -func Set(b *testing.B, store raft.StableStore) { - // Run Set a number of times - for n := 0; n < b.N; n++ { - if err := store.Set([]byte{byte(n)}, []byte("val")); err != nil { - b.Fatalf("err: %s", err) - } - } -} - -func Get(b *testing.B, store raft.StableStore) { - // Create some fake data - for i := 1; i < 10; i++ { - if err := store.Set([]byte{byte(i)}, []byte("val")); err != nil { - b.Fatalf("err: %s", err) - } - } - b.ResetTimer() - - // Run Get a number of times - for n := 0; n < b.N; n++ { - if _, err := store.Get([]byte{0x05}); err != nil { - b.Fatalf("err: %s", err) - } - } -} - -func SetUint64(b *testing.B, store raft.StableStore) { - // Run SetUint64 a number of times - for n := 0; n < b.N; n++ { - if err := store.SetUint64([]byte{byte(n)}, uint64(n)); err != nil { - b.Fatalf("err: %s", err) - } - } -} - -func GetUint64(b *testing.B, store raft.StableStore) { - // Create some fake data - for i := 0; i < 10; i++ { - if err := store.SetUint64([]byte{byte(i)}, uint64(i)); err != nil { - b.Fatalf("err: %s", err) - } - } - b.ResetTimer() - - // Run GetUint64 a number of times - for n := 0; n < b.N; n++ { - if _, err := store.Get([]byte{0x05}); err != nil { - b.Fatalf("err: %s", err) - } - } -} 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 1c53cfc86e7..00000000000 --- 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 d550e969547..00000000000 --- 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 e3fa196b14f..00000000000 --- 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 0c26248d079..00000000000 --- 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 4a62d951a65..00000000000 --- 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 5b9f52b1159..00000000000 --- 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 8b8db363a2b..00000000000 --- 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 7998a41ac9d..00000000000 --- 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 aa03b35dd7f..00000000000 --- 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 c6706b97196..00000000000 --- 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 8f2a481ed7c..00000000000 --- 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 2127cf441ba..00000000000 --- 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 b10c0a496d6..00000000000 --- 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 359477278c8..00000000000 --- 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 003c2945887..00000000000 --- 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 6b07b0b6dae..00000000000 --- 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 3bcec302815..00000000000 --- 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 19102815663..00000000000 --- 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 4d5f9756e55..00000000000 --- 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 bc4f6a3f49c..00000000000 --- 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 81bf07a7a1b..00000000000 --- 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 3225de91399..00000000000 --- 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 8cac9595822..00000000000 --- 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 bd76f47e216..00000000000 --- 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 c719add3deb..00000000000 --- 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 ff12f04f148..00000000000 --- 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 0eccba1d3a0..00000000000 --- 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 ab14b0fa8e6..00000000000 --- 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 f1514bb7438..00000000000 --- 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 09276059a23..00000000000 --- 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 ab14b0fa8e6..00000000000 --- 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 bfb41ae9875..00000000000 --- 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 915ec172ae7..00000000000 --- 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 5b74e9b593f..00000000000 --- 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 64c5e5885a4..00000000000 --- 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 f34dcd8fade..00000000000 --- 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 e335dc96fea..00000000000 --- 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 aac28fffeb3..00000000000 --- 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 1c6fd67198e..00000000000 --- 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 93e68db7759..00000000000 --- 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 554601ea427..00000000000 --- 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 1ab2d9834f8..00000000000 --- 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 1d19714ffbc..00000000000 --- 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 3cee2f56f15..00000000000 --- 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 4821f9aefcf..00000000000 --- 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 40b6913a6c0..00000000000 --- 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 c711252be28..00000000000 --- 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 ec5d07e95cc..00000000000 --- 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 2080401e1ea..00000000000 --- 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 c5ee2ba5cb8..00000000000 --- 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 1814ca17b87..00000000000 --- 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 e03cdb0d640..00000000000 --- 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 7fea8d2ce5c..00000000000 --- 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 a17c92f5974..00000000000 --- 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 4f1d882a406..00000000000 --- 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 4f1d882a406..00000000000 --- 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 19ec1fe0900..00000000000 --- 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 761c68a6b59..00000000000 --- 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 a0dd68eaa90..00000000000 --- 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 a4190b2ba25..00000000000 --- 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 f5033c30223..00000000000 --- 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 822f054d50c..00000000000 --- 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 a584adcc0c5..00000000000 --- 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 fb4cc5dc482..00000000000 --- 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 693f9549627..00000000000 --- 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 aa260fabc17..00000000000 --- 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 d8c58826afd..00000000000 --- 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 32e16b7bb00..00000000000 --- 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 5f575ae7fc4..00000000000 --- 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 f31551c62fd..00000000000 --- 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 18b90446cc9..00000000000 --- 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 def4d0bc19c..00000000000 --- 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 48e4a7707c7..00000000000 --- 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 9fb939a0b1b..00000000000 --- 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 86155ed7546..00000000000 --- 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 74ba7cc67db..00000000000 --- 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 57f8b983f08..00000000000 --- 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 d17c7345faf..00000000000 --- 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 15f70f78399..00000000000 --- 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 9b227529b40..00000000000 --- 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 489a42935a6..00000000000 --- 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 d17106a00f5..00000000000 --- 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 4f4ae9e6890..00000000000 --- 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 ce932e2e6ac..00000000000 --- 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 e246fa4dbcb..00000000000 --- 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 de0b4c39d99..00000000000 --- 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 f8c264747e9..00000000000 --- 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 7d423b1cd19..00000000000 --- 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 503716b687c..00000000000 --- 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 7f61dfa157b..00000000000 --- 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 ee72a8c01ac..00000000000 --- 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 8d8f1f75906..00000000000 --- 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 8cb54ba47b3..00000000000 --- 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 cf2c9b1db2e..00000000000 --- 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 b516b2c489f..00000000000 --- 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 e047d486682..00000000000 --- 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 c4cc87b9c12..00000000000 --- 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 2c7fa0a9c1e..00000000000 --- 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 eb096e61cdd..00000000000 --- 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 4958abaec45..00000000000 --- 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 1027084724d..00000000000 --- 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 83cb9161282..00000000000 --- 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 a494d6c4bf1..00000000000 --- 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 2294fc54d12..00000000000 --- 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 bb8c2b46d1f..00000000000 --- 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 e3ed49ac653..00000000000 --- 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 3ab0290340a..00000000000 --- 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 97db56f7b67..00000000000 --- 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 a7e648de963..00000000000 --- 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 be4348d0c1e..00000000000 --- 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 a707283d499..00000000000 --- 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 2cd6618d84b..00000000000 --- 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 833e6837382..00000000000 --- 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 706dbda89a8..00000000000 --- 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 ca593ca93c1..00000000000 --- 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 4d5f9756e55..00000000000 --- 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 f300ab91782..00000000000 --- 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 9c93843541d..00000000000 --- 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 c1b0730e013..00000000000 --- 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 1552ec63a6f..00000000000 --- 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 047041273f0..00000000000 --- 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 efd782cc325..00000000000 --- 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 8494ac27064..00000000000 --- 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 c61f7f7ebd8..00000000000 --- 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 f6055f1898f..00000000000 --- 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 4f58e0e7bd2..00000000000 --- 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 f536bfbf687..00000000000 --- 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 ef47ff2c056..00000000000 --- 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 69759281cb4..00000000000 --- 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 c3e8b5927fb..00000000000 --- 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 24ecc222cbf..00000000000 --- 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 5693009d2e4..00000000000 --- 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 62dd220e719..00000000000 --- 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 3c1e81f55ae..00000000000 --- 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 493daa673c4..00000000000 --- 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 116b50ab38b..00000000000 --- 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 0073fac4520..00000000000 --- 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 00d8fa37eeb..00000000000 --- 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 661ebcfa337..00000000000 --- 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 c14f16e0264..00000000000 --- 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 8a2443e6e90..00000000000 --- 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 c9ddacbb61f..00000000000 --- 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 d0209c6df0a..00000000000 --- 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 82649bd24ee..00000000000 --- 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 c07242aa44b..00000000000 --- 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 7aae4effc7c..00000000000 --- 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 c1574f35ffa..00000000000 --- 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 5197e3a2bf5..00000000000 --- 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 320558b0053..00000000000 --- 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 4a2cb086527..00000000000 --- 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 9524c83813c..00000000000 --- 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 066b8d98b78..00000000000 --- 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 c61f7f7ebd8..00000000000 --- 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 a582f62d282..00000000000 --- 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 a1d50731c78..00000000000 --- 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 e3c5eedeb59..00000000000 --- 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 e75309a5241..00000000000 --- 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 027177272c5..00000000000 --- 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 99432276ec4..00000000000 --- 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 d4f8a788b80..00000000000 --- 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 56c384f7530..00000000000 --- 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 f093d2aa3bc..00000000000 --- 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 11e1229d9e3..00000000000 --- 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 90dbfcfcd35..00000000000 --- 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 b06b8302524..00000000000 --- 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 5f55d73af66..00000000000 --- 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 0e4bf7c113b..00000000000 --- 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 81bb45f8059..00000000000 --- 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 d0b4de14642..00000000000 --- 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 68797580caa..00000000000 --- 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 e61be91c4af..00000000000 --- 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 026cb9cbb51..00000000000 --- 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 ca9587d06c0..00000000000 --- 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 67f6d9c42a3..00000000000 --- 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 927ab653a73..00000000000 --- 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 39307ab938e..00000000000 --- 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 8b0c5b41bd9..00000000000 --- 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 a3ec2ed7a12..00000000000 --- 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 26bf7e122de..00000000000 --- 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 d595c9f43a9..00000000000 --- 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 f6869694967..00000000000 --- 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 f3a9b7edb50..00000000000 --- 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 455f00ffc29..00000000000 --- 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 ccd5968f9c1..00000000000 --- 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 ee55c16fc81..00000000000 --- 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 0d1a169a67a..00000000000 --- 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 0573cfd73fd..00000000000 --- 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 f0fcbd8eaf4..00000000000 --- 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 4f8e6a17aab..00000000000 --- 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 a0db02bebf1..00000000000 --- 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 56032f7a248..00000000000 --- 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 4a8a3cff369..00000000000 --- 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 7c1efac0004..00000000000 --- 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 a0f489d532f..00000000000 --- 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 c64e8d5ac8b..00000000000 --- 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 0567e992f14..00000000000 --- 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 ce8245c5b97..00000000000 --- 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 8f16a5ac048..00000000000 --- 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 504ff5ae39f..00000000000 --- 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 07fb57234b8..00000000000 --- 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 533dd8e5460..00000000000 --- 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 1e4a3a34155..00000000000 --- 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 37961f6ca42..00000000000 --- 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 23480cff14c..00000000000 --- 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 e609f81a3b8..00000000000 --- 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 d89a25f0b97..00000000000 --- 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 5adcf5e7dc5..00000000000 --- 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 ace4a897d33..00000000000 --- 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 feffb7061b3..00000000000 --- 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 8223f1e51e3..00000000000 --- 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 7e85c4bdfe9..00000000000 --- 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 c9cdc63b070..00000000000 --- 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 c82f7982ee0..00000000000 --- 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 dae65c51554..00000000000 --- 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 b6b3695438a..00000000000 --- 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 bf06e678c15..00000000000 --- 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 5d48e0205ce..00000000000 --- 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 de3af7230f9..00000000000 --- 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 a1c33350841..00000000000 --- 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 ad0fef91cfa..00000000000 --- 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 3e83c6f7306..00000000000 --- 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 72fc0a53e79..00000000000 --- 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 433a737d65e..00000000000 --- 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 4d5f9756e55..00000000000 --- 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 5e0d9b71772..00000000000 --- 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 3cd7e9460fe..00000000000 --- 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 74cb1765558..00000000000 --- 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 3cf2007f70d..00000000000 --- 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 9674d880375..00000000000 --- 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 9b0b2f8189b..00000000000 --- 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 83c639a185b..00000000000 --- 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 3b76c9f64a4..00000000000 --- 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 9a2b0184edf..00000000000 --- 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 ff99e045d2e..00000000000 --- 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 040ecb240c8..00000000000 --- 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 6e7ea636eec..00000000000 --- 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 bace2a0be17..00000000000 --- 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 5d50c80c068..00000000000 --- 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 99d21a2a0f0..00000000000 --- 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 133a9c6272f..00000000000 --- 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 b7f78c5dc51..00000000000 --- 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 bd9de815f45..00000000000 --- 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 55e6257352f..00000000000 --- 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 fa83f1da3b7..00000000000 --- 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 1661747c04d..00000000000 --- 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 1661747c04d..00000000000 --- 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 3debc70f895..00000000000 --- 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 75af2fda069..00000000000 --- 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 4a70cd8a03c..00000000000 --- 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 987985b002f..00000000000 --- 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 1661747c04d..00000000000 --- 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 634f937e555..00000000000 --- 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 09cb7b8bb1b..00000000000 --- 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 f5d9ac5b763..00000000000 --- 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 463a2a542db..00000000000 --- 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 d1016d6e75b..00000000000 --- 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 ef54cf52d67..00000000000 --- 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 bea506ff235..00000000000 --- 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 20dd081e0e4..00000000000 --- 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 4803734b09e..00000000000 --- 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 1be56598534..00000000000 --- 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 d2cf6da59fe..00000000000 --- 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 c609ca64b16..00000000000 --- 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 19102815663..00000000000 --- 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 bea506ff235..00000000000 --- 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 10ed5d3f61f..00000000000 --- 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 13f2c4a0b4f..00000000000 --- 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 edf3d92775d..00000000000 --- 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 2a3b993af24..00000000000 --- 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 d5ca878a13b..00000000000 --- 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 fcd255f5d0c..00000000000 --- 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 2d53bd7cdcd..00000000000 --- 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 cb10d2497e1..00000000000 --- 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 f6c79ca84ff..00000000000 --- 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 09bf36e8a90..00000000000 --- 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 4c357818919..00000000000 --- 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 16a4c36acbd..00000000000 --- 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 2dd8ae21855..00000000000 --- 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 dfed8160389..00000000000 --- 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 d7628e646e1..00000000000 --- 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 49c5269b12e..00000000000 --- 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 d5db721d012..00000000000 --- 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 a2b6e4ec85d..00000000000 --- 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 f5801bdd680..00000000000 --- 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 f87db59a8b7..00000000000 --- 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 3b20d905f33..00000000000 --- 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 70bcd29a7a8..00000000000 --- 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 351054d3e61..00000000000 --- 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 0918d41559b..00000000000 --- 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 ef70c4c11e7..00000000000 --- 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 b39a922f403..00000000000 --- 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 7e65687dbfc..00000000000 --- 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 770d1ece705..00000000000 --- 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 a8b81985c76..00000000000 --- 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 7f0861065e7..00000000000 --- 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 495114d919e..00000000000 --- 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 94f355c46ca..00000000000 --- 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 600d2aa3f49..00000000000 --- 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 31485223580..00000000000 --- 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 99d9258a625..00000000000 --- 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 637015b5fde..00000000000 --- 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 6fa7557b8d8..00000000000 --- 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 5aabeec3419..00000000000 --- 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 8302ea1984d..00000000000 --- 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 d88d014a96c..00000000000 --- 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 47152dddb73..00000000000 --- 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 895d4293878..00000000000 --- 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 42500a368cc..00000000000 --- 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 08b944dad4a..00000000000 --- 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 6de163f80bc..00000000000 --- 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 5bc357d9fa6..00000000000 --- 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 b84bbdb29fb..00000000000 --- 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 bf6a07ace3d..00000000000 --- 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 c742f5b0c97..00000000000 --- 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 04e9b3ade60..00000000000 --- 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 ebdaf120d7b..00000000000 --- 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 d0ba5d7facb..00000000000 --- 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 19c2e2ef41c..00000000000 --- 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 5faa483b197..00000000000 --- 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 e3c05c163a3..00000000000 --- 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 7c13861ac72..00000000000 --- 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 d037a0a4ddf..00000000000 --- 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 f795c255219..00000000000 --- 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 772c45639cc..00000000000 --- 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 8808e92bf31..00000000000 --- 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 3f13757a10c..00000000000 --- 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 23cd8903e73..00000000000 --- 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 fabb6da4fe8..00000000000 --- 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 4c3f615b1cd..00000000000 --- 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 8bc46535ac5..00000000000 --- 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 2024b6f118d..00000000000 --- 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 b52191d10a4..00000000000 --- 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 8534a5cae9f..00000000000 --- 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 5cd310b6d24..00000000000 --- 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 0b24ef53526..00000000000 --- 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 473c1c351b4..00000000000 --- 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 44ba735ab10..00000000000 --- 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 f5f89b12b5c..00000000000 --- 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 697764cb306..00000000000 --- 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 20447fb1054..00000000000 --- 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 310b9b1dd27..00000000000 --- 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 c79b2e24068..00000000000 --- 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 ab498ef654c..00000000000 --- 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 71307c40947..00000000000 --- 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 4b8f39a468e..00000000000 --- 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 b8f9020f8e7..00000000000 --- 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 b7c7b3f6556..00000000000 --- 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 fabb6da4fe8..00000000000 --- 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 c15c39f82c1..00000000000 --- 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 9cebd89844f..00000000000 --- 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 c5bbfbf848f..00000000000 --- 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 d81cb2b9041..00000000000 --- 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 3a65aa7d6f1..00000000000 --- 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 8808e92bf31..00000000000 --- 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 e142b22a25f..00000000000 --- 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 ab498ef654c..00000000000 --- 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 8e3d22dc53f..00000000000 --- 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 398c7f8b06e..00000000000 --- 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 a1764448785..00000000000 --- 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 da5225ddccb..00000000000 --- 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 a8870b22bcc..00000000000 --- 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 420b1a57c45..00000000000 --- 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 0761ee16dc0..00000000000 --- 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 aa1191a48cd..00000000000 --- 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 19102815663..00000000000 --- 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 9a24a464eed..00000000000 --- 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 bea506ff235..00000000000 --- 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 13f2c4a0b4f..00000000000 --- 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 edf3d92775d..00000000000 --- 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 d965466e91c..00000000000 --- 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 f1822a1742b..00000000000 --- 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 c6f77b80c33..00000000000 --- 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 db56262a4ea..00000000000 --- 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 b901067d271..00000000000 --- 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 738479fa69b..00000000000 --- 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 6926996a7b6..00000000000 --- 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 6d33cc72c4e..00000000000 --- 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 736be0a31f2..00000000000 --- 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 29e1fb20a55..00000000000 --- 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 c0070ba783a..00000000000 --- 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 661b0bec5e3..00000000000 --- 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 296d5aeee16..00000000000 --- 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 ca140f8aa33..00000000000 --- 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 15d30924274..00000000000 --- 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 56148d957b7..00000000000 --- 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 6d3cf6d9069..00000000000 --- 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 100fa8339d5..00000000000 --- 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 de56fc042cb..00000000000 --- 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 64490352bf0..00000000000 --- 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 af901bde17e..00000000000 --- 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 36b63e462c4..00000000000 --- 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 aba584f99ed..00000000000 --- 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 4234ac01922..00000000000 --- 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 12330d9902c..00000000000 --- 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 1b2d93e1952..00000000000 --- 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 c371fc6457a..00000000000 --- 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 3c835642eb2..00000000000 --- 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 decaa0421d6..00000000000 --- 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 49d9c63a390..00000000000 --- 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 b91068037b1..00000000000 --- 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 11df74d8b46..00000000000 --- 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 11df74d8b46..00000000000 --- 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 37da9fc0b71..00000000000 --- 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 1f4fc943d70..00000000000 --- 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 67c7ea9cfe4..00000000000 --- 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 d87f9bba4cd..00000000000 --- 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 ebf8e271140..00000000000 --- 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 f32bc6db510..00000000000 --- 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 d04459d9090..00000000000 --- 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 b537264a1d5..00000000000 --- 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 c17c1df1706..00000000000 --- 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 3eb869f435b..00000000000 --- 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 aa5d6be52c7..00000000000 --- 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 1a4d1682da0..00000000000 --- 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 5925a578b52..00000000000 --- 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 081e93abd98..00000000000 --- 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 92270014959..00000000000 --- 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 fd2294d6646..00000000000 --- 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 c6b551d5eae..00000000000 --- 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 503f58da6e3..00000000000 --- 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 f78bb770caa..00000000000 --- 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 589a214f453..00000000000 --- 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 eb9d2ba881e..00000000000 --- 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 1921a3d9865..00000000000 --- 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 a87afcb1b32..00000000000 --- 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 dbf51d8cde4..00000000000 --- 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 f7288763a71..00000000000 --- 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 64395761df6..00000000000 --- 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 706bb14dd7e..00000000000 --- 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 8fcfaee95c6..00000000000 --- 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 f6a00bf9bbc..00000000000 --- 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 ea068ee06fb..00000000000 --- 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 214917ac068..00000000000 --- 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 1fe14258edc..00000000000 --- 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 4ba0e130228..00000000000 --- 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 25db439ff7d..00000000000 --- 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 8a965920af5..00000000000 --- 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 b1e5ba3734f..00000000000 --- 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 06253112e4e..00000000000 --- 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 1e14a6a4c5e..00000000000 --- 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 aef5c2747d2..00000000000 --- 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 93c95fcf689..00000000000 --- 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 7e0733e595e..00000000000 --- 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 4c002ed80d6..00000000000 --- 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 2438b25762d..00000000000 --- 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 549994b6bc4..00000000000 --- 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 ab98292b452..00000000000 --- 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 65fca968764..00000000000 --- 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 18c5daf7bea..00000000000 --- 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 1bb84f7d4bd..00000000000 --- 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 7a0416f0566..00000000000 --- 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 4d5f9756e55..00000000000 --- 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 19102815663..00000000000 --- 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 f59ec20aabf..00000000000 --- 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 23d27073e97..00000000000 --- 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 dee5695746e..00000000000 --- 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 1a16f7418d2..00000000000 --- 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 7e8066d39f5..00000000000 --- 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 0637a088a01..00000000000 --- 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 6e7ea636eec..00000000000 --- 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 5a5194647ad..00000000000 --- 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 416127425c2..00000000000 --- 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 cd9fb6ba778..00000000000 --- 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 9f3ada48077..00000000000 --- 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 9b0b2f8189b..00000000000 --- 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 6d840ee568f..00000000000 --- 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 b23413b92af..00000000000 --- 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 08ab2e1c420..00000000000 --- 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 78b05a5c64e..00000000000 --- 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 1e7b886e79e..00000000000 --- 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 91b4c9896e1..00000000000 --- 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 8301ef981ef..00000000000 --- 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 8f75cc91334..00000000000 --- 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 e5f122c5691..00000000000 --- 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 39d1914328b..00000000000 --- 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 d08bbe2501e..00000000000 --- 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 addaf204c5b..00000000000 --- 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 a77f355812c..00000000000 --- 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 c9697aa4870..00000000000 --- 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 fd7064a0868..00000000000 --- 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 61e5e1b8f71..00000000000 --- 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 bc9d8af1d92..00000000000 --- 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 2dd54dc3904..00000000000 --- 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 19102815663..00000000000 --- 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 7e9668e7834..00000000000 --- 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 d58ac16bf03..00000000000 --- 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 33ac9fba6ff..00000000000 --- 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 acf2435c7cb..00000000000 --- 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 99e19638ce4..00000000000 --- 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 be0845011c3..00000000000 --- 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 a84b51e1cda..00000000000 --- 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 c2de55815f0..00000000000 --- 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 dc2dda0bb68..00000000000 --- 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 a2d3d5f6ae0..00000000000 --- 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 0971c37eaf7..00000000000 --- 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 0e39dfd695d..00000000000 --- 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 89c1ce22dc7..00000000000 --- 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 5199b9f95d4..00000000000 --- 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 99fe382c6c6..00000000000 --- 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 5bb6d4ae783..00000000000 --- 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 edac73189d7..00000000000 --- 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 458d0a6ddd0..00000000000 --- 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 f757fd53459..00000000000 --- 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 670049d96f7..00000000000 --- 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 3c88caafe88..00000000000 --- 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 f59ec20aabf..00000000000 --- 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 0852fcc7895..00000000000 --- 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 dee5695746e..00000000000 --- 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 66781bba40a..00000000000 --- 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 4aad20ae69e..00000000000 --- 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 0db15d97e44..00000000000 --- 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 b24be9d7d1c..00000000000 --- 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 e6efe133fcd..00000000000 --- 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 5a5194647ad..00000000000 --- 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 cd9fb6ba778..00000000000 --- 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 cbf1a5d596a..00000000000 --- 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 8bd13b7eb49..00000000000 --- 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 7239f3e887e..00000000000 --- 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 f5e431d9e3f..00000000000 --- 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 d0c25953968..00000000000 --- 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 b9749b74897..00000000000 --- 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 dac67509bb4..00000000000 --- 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 a6388271e41..00000000000 --- 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 2a66ffe93b8..00000000000 --- 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 b6b3695438a..00000000000 --- 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 7e57f9e74ce..00000000000 --- 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 c5f8bef0bee..00000000000 --- 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 3decf08030f..00000000000 --- 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 655e2959bea..00000000000 --- 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 2aa159718c8..00000000000 --- 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 556b380bab1..00000000000 --- 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 0de3229b83e..00000000000 --- 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 130ed3b379e..00000000000 --- 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 3b511f13351..00000000000 --- 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 c8dfa16e6bc..00000000000 --- 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 69f04ee23ff..00000000000 --- 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 3b511f13351..00000000000 --- 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 03e0c0cb93b..00000000000 --- 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 ac1c8966821..00000000000 --- 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 03e0c0cb93b..00000000000 --- 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 ac1c8966821..00000000000 --- 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 6494cf1c6a0..00000000000 --- 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 1406be5721f..00000000000 --- 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 3d15fcc1697..00000000000 --- 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 72b5aa281a9..00000000000 --- 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 02a26491ae4..00000000000 --- 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 cb08037e209..00000000000 --- 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 91d695995a4..00000000000 --- 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 f40f261ad17..00000000000 --- 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 03904b1dece..00000000000 --- 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 fd7c21c340c..00000000000 --- 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 d7ca4719a99..00000000000 --- 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 b3ddffe3cfe..00000000000 --- 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 c03cd39ebf5..00000000000 --- 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 08731af6908..00000000000 --- 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 b3c40cd533f..00000000000 --- 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 c5930d543f3..00000000000 --- 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 cc0b1a4896a..00000000000 --- 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 d677b965852..00000000000 --- 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 c1166640155..00000000000 --- 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 e3399771088..00000000000 --- 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 76f53453a8a..00000000000 --- 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 dd485072f26..00000000000 --- 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 16000c003cd..00000000000 --- 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 1d0d03ed3b5..00000000000 --- 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 b67aebe98ad..00000000000 --- 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 7e8066d39f5..00000000000 --- 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 41ebe5ba9d7..00000000000 --- 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 fe0397993c5..00000000000 --- 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 1a27fd80c3c..00000000000 --- 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 559a13456be..00000000000 --- 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 e31621b438e..00000000000 --- 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 6bf7a10362a..00000000000 --- 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 41ebe5ba9d7..00000000000 --- 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 28b9bcbbb52..00000000000 --- 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 41ebe5ba9d7..00000000000 --- 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 d3ac793bb6b..00000000000 --- 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 fe0397993c5..00000000000 --- 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 1a27fd80c3c..00000000000 --- 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 559a13456be..00000000000 --- 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 e31621b438e..00000000000 --- 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 6bf7a10362a..00000000000 --- 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 41ebe5ba9d7..00000000000 --- 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 28b9bcbbb52..00000000000 --- 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 065295bc17a..00000000000 --- 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 43d164927d4..00000000000 --- 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 6b884fa866f..00000000000 --- 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 d85c779d0a3..00000000000 --- 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 44d6628cdc6..00000000000 --- 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 3e6dcf3045a..00000000000 --- 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 bdb820b30b3..00000000000 --- 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 3f3048a004c..00000000000 --- 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 dacc2572451..00000000000 --- 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 32ebae8800b..00000000000 --- 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 dcd023e0fbc..00000000000 --- 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 e08cc13cbe3..00000000000 --- 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 1ec43f45fce..00000000000 --- 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 30387116349..00000000000 --- 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 e3875746b35..00000000000 --- 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 da7bc1ccfd0..00000000000 --- 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 5c3d683565d..00000000000 --- 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 6232808f0ae..00000000000 --- 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 6232808f0ae..00000000000 --- 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 29497f4ff54..00000000000 --- 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 29497f4ff54..00000000000 --- 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 346696563f8..00000000000 --- 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 346696563f8..00000000000 --- 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 c6268f8473b..00000000000 --- 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 7ce703695ee..00000000000 --- 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 0561bc26d9a..00000000000 --- 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 19102815663..00000000000 --- 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 c78c1fc3002..00000000000 --- 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 ebcb4bbdbb9..00000000000 --- 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 6edbf1afe4a..00000000000 --- 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 d2b2f070dab..00000000000 --- 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 3535da2eca6..00000000000 --- 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 ba839fe60d1..00000000000 --- 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 f4358186979..00000000000 --- 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 adb65fc01f0..00000000000 --- 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 93d6901bead..00000000000 --- 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 c7df08782a1..00000000000 --- 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/mesos/mesos-go/auth/sasl/mock/mock.go b/vendor/github.com/mesos/mesos-go/auth/sasl/mock/mock.go deleted file mode 100644 index 24dfb5c98eb..00000000000 --- a/vendor/github.com/mesos/mesos-go/auth/sasl/mock/mock.go +++ /dev/null @@ -1,17 +0,0 @@ -package mock - -import ( - "github.com/gogo/protobuf/proto" - mock_messenger "github.com/mesos/mesos-go/messenger/mock" - "github.com/mesos/mesos-go/upid" - "github.com/stretchr/testify/mock" - "golang.org/x/net/context" -) - -type Transport struct { - *mock_messenger.Messenger -} - -func (m *Transport) Send(ctx context.Context, upid *upid.UPID, msg proto.Message) error { - return m.Called(mock.Anything, upid, msg).Error(0) -} diff --git a/vendor/github.com/mesos/mesos-go/detector/zoo/mock/conn.go b/vendor/github.com/mesos/mesos-go/detector/zoo/mock/conn.go deleted file mode 100644 index a918ab341b4..00000000000 --- a/vendor/github.com/mesos/mesos-go/detector/zoo/mock/conn.go +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 mock - -import ( - "github.com/samuel/go-zookeeper/zk" - "github.com/stretchr/testify/mock" -) - -// Impersontates a zk.Connection -// It implements interface Connector -type Connector struct { - mock.Mock -} - -func NewConnector() *Connector { - return new(Connector) -} - -func (conn *Connector) Close() { - conn.Called() -} - -func (conn *Connector) ChildrenW(path string) ([]string, *zk.Stat, <-chan zk.Event, error) { - args := conn.Called(path) - var ( - arg0 []string - arg1 *zk.Stat - arg2 <-chan zk.Event - ) - if args.Get(0) != nil { - arg0 = args.Get(0).([]string) - } - if args.Get(1) != nil { - arg1 = args.Get(1).(*zk.Stat) - } - if args.Get(2) != nil { - arg2 = args.Get(2).(<-chan zk.Event) - } - return arg0, arg1, arg2, args.Error(3) -} - -func (conn *Connector) Children(path string) ([]string, *zk.Stat, error) { - args := conn.Called(path) - return args.Get(0).([]string), - args.Get(1).(*zk.Stat), - args.Error(2) -} - -func (conn *Connector) Get(path string) ([]byte, *zk.Stat, error) { - args := conn.Called(path) - return args.Get(0).([]byte), - args.Get(1).(*zk.Stat), - args.Error(2) -} diff --git a/vendor/github.com/mesos/mesos-go/detector/zoo/mock/mock.go b/vendor/github.com/mesos/mesos-go/detector/zoo/mock/mock.go deleted file mode 100644 index a788cbb9eda..00000000000 --- a/vendor/github.com/mesos/mesos-go/detector/zoo/mock/mock.go +++ /dev/null @@ -1,81 +0,0 @@ -package mock - -import ( - "sync" - - log "github.com/golang/glog" - "github.com/mesos/mesos-go/detector/zoo" - mesos "github.com/mesos/mesos-go/mesosproto" - "github.com/stretchr/testify/mock" -) - -type Client struct { - mock.Mock -} - -func (m *Client) Stopped() (a <-chan struct{}) { - args := m.Called() - if x := args.Get(0); x != nil { - a = x.(<-chan struct{}) - } - return -} - -func (m *Client) Stop() { - m.Called() -} - -func (m *Client) Data(path string) (a []byte, b error) { - args := m.Called(path) - if x := args.Get(0); x != nil { - a = x.([]byte) - } - b = args.Error(1) - return -} - -func (m *Client) WatchChildren(path string) (a string, b <-chan []string, c <-chan error) { - args := m.Called(path) - a = args.String(0) - if x := args.Get(1); x != nil { - b = x.(<-chan []string) - } - if x := args.Get(2); x != nil { - c = x.(<-chan error) - } - return -} - -// newMockZkClient returns a mocked implementation of ZKInterface that implements expectations -// for Stop() and Stopped(); multiple calls to Stop() are safe. -func NewClient(testZkPath string, initialChildren ...string) (mocked *Client, snaps chan []string, errs chan error) { - var doneOnce sync.Once - done := make(chan struct{}) - - mocked = &Client{} - mocked.On("Stop").Return().Run(func(_ mock.Arguments) { doneOnce.Do(func() { close(done) }) }) - mocked.On("Stopped").Return((<-chan struct{})(done)) - - if initialChildren != nil { - errs = make(chan error) // this is purposefully unbuffered (some tests depend on this) - snaps = make(chan []string, 1) - snaps <- initialChildren[:] - mocked.On("WatchChildren", zoo.CurrentPath).Return( - testZkPath, (<-chan []string)(snaps), (<-chan error)(errs)).Run( - func(_ mock.Arguments) { log.V(1).Infoln("WatchChildren invoked") }) - } - return -} - -// implements MasterChanged and AllMasters extension -type AllMastersListener struct { - mock.Mock -} - -func (a *AllMastersListener) OnMasterChanged(mi *mesos.MasterInfo) { - a.Called(mi) -} - -func (a *AllMastersListener) UpdatedMasters(mi []*mesos.MasterInfo) { - a.Called(mi) -} diff --git a/vendor/github.com/mesos/mesos-go/examples/Godeps/_workspace/src/github.com/golang/glog/LICENSE b/vendor/github.com/mesos/mesos-go/examples/Godeps/_workspace/src/github.com/golang/glog/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/github.com/mesos/mesos-go/examples/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/mesos/mesos-go/examples/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE b/vendor/github.com/mesos/mesos-go/examples/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE deleted file mode 100644 index 5dc68268d90..00000000000 --- a/vendor/github.com/mesos/mesos-go/examples/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009,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/mesos/mesos-go/examples/Godeps/_workspace/src/github.com/stretchr/objx/LICENSE.md b/vendor/github.com/mesos/mesos-go/examples/Godeps/_workspace/src/github.com/stretchr/objx/LICENSE.md deleted file mode 100644 index 2199945813c..00000000000 --- a/vendor/github.com/mesos/mesos-go/examples/Godeps/_workspace/src/github.com/stretchr/objx/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -objx - by Mat Ryer and Tyler Bunnell - -The MIT License (MIT) - -Copyright (c) 2014 Stretchr, Inc. - -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/mesos/mesos-go/executor/mock/mock.go b/vendor/github.com/mesos/mesos-go/executor/mock/mock.go deleted file mode 100644 index 7223e78c388..00000000000 --- a/vendor/github.com/mesos/mesos-go/executor/mock/mock.go +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 mock - -import ( - "github.com/mesos/mesos-go/executor" - "github.com/mesos/mesos-go/mesosproto" - "github.com/stretchr/testify/mock" -) - -// Executor is used for testing the executor driver. -type Executor struct { - mock.Mock -} - -// New returns a mocked executor. -func New() *Executor { - return &Executor{} -} - -// Registered implements the Registered handler. -func (e *Executor) Registered(executor.ExecutorDriver, *mesosproto.ExecutorInfo, *mesosproto.FrameworkInfo, *mesosproto.SlaveInfo) { - e.Called() -} - -// Reregistered implements the Reregistered handler. -func (e *Executor) Reregistered(executor.ExecutorDriver, *mesosproto.SlaveInfo) { - e.Called() -} - -// Disconnected implements the Disconnected handler. -func (e *Executor) Disconnected(executor.ExecutorDriver) { - e.Called() -} - -// LaunchTask implements the LaunchTask handler. -func (e *Executor) LaunchTask(executor.ExecutorDriver, *mesosproto.TaskInfo) { - e.Called() -} - -// KillTask implements the KillTask handler. -func (e *Executor) KillTask(executor.ExecutorDriver, *mesosproto.TaskID) { - e.Called() -} - -// FrameworkMessage implements the FrameworkMessage handler. -func (e *Executor) FrameworkMessage(executor.ExecutorDriver, string) { - e.Called() -} - -// Shutdown implements the Shutdown handler. -func (e *Executor) Shutdown(executor.ExecutorDriver) { - e.Called() -} - -// Error implements the Error handler. -func (e *Executor) Error(executor.ExecutorDriver, string) { - e.Called() -} diff --git a/vendor/github.com/mesos/mesos-go/messenger/mock/messenger.go b/vendor/github.com/mesos/mesos-go/messenger/mock/messenger.go deleted file mode 100644 index 6496507bc07..00000000000 --- a/vendor/github.com/mesos/mesos-go/messenger/mock/messenger.go +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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 mock - -import ( - "reflect" - - "github.com/gogo/protobuf/proto" - "github.com/mesos/mesos-go/messenger" - "github.com/mesos/mesos-go/upid" - "github.com/stretchr/testify/mock" - "golang.org/x/net/context" -) - -type message struct { - from *upid.UPID - msg proto.Message -} - -// Messenger is a messenger that returns error on every operation. -type Messenger struct { - mock.Mock - messageQueue chan *message - handlers map[string]messenger.MessageHandler - stop chan struct{} -} - -// NewMessenger returns a mocked messenger used for testing. -func NewMessenger() *Messenger { - return &Messenger{ - messageQueue: make(chan *message, 1), - handlers: make(map[string]messenger.MessageHandler), - stop: make(chan struct{}), - } -} - -// Install is a mocked implementation. -func (m *Messenger) Install(handler messenger.MessageHandler, msg proto.Message) error { - m.handlers[reflect.TypeOf(msg).Elem().Name()] = handler - return m.Called().Error(0) -} - -// Send is a mocked implementation. -func (m *Messenger) Send(ctx context.Context, upid *upid.UPID, msg proto.Message) error { - return m.Called().Error(0) -} - -func (m *Messenger) Route(ctx context.Context, upid *upid.UPID, msg proto.Message) error { - return m.Called().Error(0) -} - -// Start is a mocked implementation. -func (m *Messenger) Start() error { - go m.recvLoop() - return m.Called().Error(0) -} - -// Stop is a mocked implementation. -func (m *Messenger) Stop() error { - // don't close an already-closed channel - select { - case <-m.stop: - // noop - default: - close(m.stop) - } - return m.Called().Error(0) -} - -// UPID is a mocked implementation. -func (m *Messenger) UPID() upid.UPID { - return m.Called().Get(0).(upid.UPID) -} - -func (m *Messenger) recvLoop() { - for { - select { - case <-m.stop: - return - case msg := <-m.messageQueue: - name := reflect.TypeOf(msg.msg).Elem().Name() - m.handlers[name](msg.from, msg.msg) - } - } -} - -// Recv receives a upid and a message, it will dispatch the message to its handler -// with the upid. This is for testing. -func (m *Messenger) Recv(from *upid.UPID, msg proto.Message) { - m.messageQueue <- &message{from, msg} -} diff --git a/vendor/github.com/mesos/mesos-go/messenger/testmessage/Makefile b/vendor/github.com/mesos/mesos-go/messenger/testmessage/Makefile deleted file mode 100644 index 9bf30108452..00000000000 --- a/vendor/github.com/mesos/mesos-go/messenger/testmessage/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -all: testmessage.proto - protoc --proto_path=${GOPATH}/src:${GOPATH}/src/github.com/gogo/protobuf/protobuf:. --gogo_out=. testmessage.proto diff --git a/vendor/github.com/mesos/mesos-go/messenger/testmessage/generator.go b/vendor/github.com/mesos/mesos-go/messenger/testmessage/generator.go deleted file mode 100644 index 56cbe13b8e0..00000000000 --- a/vendor/github.com/mesos/mesos-go/messenger/testmessage/generator.go +++ /dev/null @@ -1,49 +0,0 @@ -package testmessage - -import ( - "math/rand" -) - -func generateRandomString(length int) string { - b := make([]byte, length) - for i := range b { - b[i] = byte(rand.Int()) - } - return string(b) -} - -// GenerateSmallMessage generates a small size message. -func GenerateSmallMessage() *SmallMessage { - v := make([]string, 3) - for i := range v { - v[i] = generateRandomString(5) - } - return &SmallMessage{Values: v} -} - -// GenerateMediumMessage generates a medium size message. -func GenerateMediumMessage() *MediumMessage { - v := make([]string, 10) - for i := range v { - v[i] = generateRandomString(10) - } - return &MediumMessage{Values: v} -} - -// GenerateBigMessage generates a big size message. -func GenerateBigMessage() *BigMessage { - v := make([]string, 20) - for i := range v { - v[i] = generateRandomString(20) - } - return &BigMessage{Values: v} -} - -// GenerateLargeMessage generates a large size message. -func GenerateLargeMessage() *LargeMessage { - v := make([]string, 30) - for i := range v { - v[i] = generateRandomString(30) - } - return &LargeMessage{Values: v} -} diff --git a/vendor/github.com/mesos/mesos-go/messenger/testmessage/testmessage.pb.go b/vendor/github.com/mesos/mesos-go/messenger/testmessage/testmessage.pb.go deleted file mode 100644 index 11035be133b..00000000000 --- a/vendor/github.com/mesos/mesos-go/messenger/testmessage/testmessage.pb.go +++ /dev/null @@ -1,1114 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: testmessage.proto -// DO NOT EDIT! - -/* -Package testmessage is a generated protocol buffer package. - -It is generated from these files: - testmessage.proto - -It has these top-level messages: - SmallMessage - MediumMessage - BigMessage - LargeMessage -*/ -package testmessage - -import proto "github.com/gogo/protobuf/proto" -import math "math" - -// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb" - -import io "io" -import fmt "fmt" -import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - -import fmt1 "fmt" -import strings "strings" -import reflect "reflect" - -import fmt2 "fmt" -import strings1 "strings" -import github_com_gogo_protobuf_proto1 "github.com/gogo/protobuf/proto" -import sort "sort" -import strconv "strconv" -import reflect1 "reflect" - -import fmt3 "fmt" -import bytes "bytes" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = math.Inf - -type SmallMessage struct { - Values []string `protobuf:"bytes,1,rep" json:"Values,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SmallMessage) Reset() { *m = SmallMessage{} } -func (*SmallMessage) ProtoMessage() {} - -func (m *SmallMessage) GetValues() []string { - if m != nil { - return m.Values - } - return nil -} - -type MediumMessage struct { - Values []string `protobuf:"bytes,1,rep" json:"Values,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MediumMessage) Reset() { *m = MediumMessage{} } -func (*MediumMessage) ProtoMessage() {} - -func (m *MediumMessage) GetValues() []string { - if m != nil { - return m.Values - } - return nil -} - -type BigMessage struct { - Values []string `protobuf:"bytes,1,rep" json:"Values,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *BigMessage) Reset() { *m = BigMessage{} } -func (*BigMessage) ProtoMessage() {} - -func (m *BigMessage) GetValues() []string { - if m != nil { - return m.Values - } - return nil -} - -type LargeMessage struct { - Values []string `protobuf:"bytes,1,rep" json:"Values,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *LargeMessage) Reset() { *m = LargeMessage{} } -func (*LargeMessage) ProtoMessage() {} - -func (m *LargeMessage) GetValues() []string { - if m != nil { - return m.Values - } - return nil -} - -func init() { -} -func (m *SmallMessage) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(data[index:postIndex])) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } - } - return nil -} -func (m *MediumMessage) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(data[index:postIndex])) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } - } - return nil -} -func (m *BigMessage) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(data[index:postIndex])) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } - } - return nil -} -func (m *LargeMessage) Unmarshal(data []byte) error { - l := len(data) - index := 0 - for index < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if index >= l { - return io.ErrUnexpectedEOF - } - b := data[index] - index++ - stringLen |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - postIndex := index + int(stringLen) - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Values = append(m.Values, string(data[index:postIndex])) - index = postIndex - default: - var sizeOfWire int - for { - sizeOfWire++ - wire >>= 7 - if wire == 0 { - break - } - } - index -= sizeOfWire - skippy, err := github_com_gogo_protobuf_proto.Skip(data[index:]) - if err != nil { - return err - } - if (index + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) - index += skippy - } - } - return nil -} -func (this *SmallMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SmallMessage{`, - `Values:` + fmt1.Sprintf("%v", this.Values) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *MediumMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MediumMessage{`, - `Values:` + fmt1.Sprintf("%v", this.Values) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *BigMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&BigMessage{`, - `Values:` + fmt1.Sprintf("%v", this.Values) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func (this *LargeMessage) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LargeMessage{`, - `Values:` + fmt1.Sprintf("%v", this.Values) + `,`, - `XXX_unrecognized:` + fmt1.Sprintf("%v", this.XXX_unrecognized) + `,`, - `}`, - }, "") - return s -} -func valueToStringTestmessage(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt1.Sprintf("*%v", pv) -} -func (m *SmallMessage) Size() (n int) { - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovTestmessage(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MediumMessage) Size() (n int) { - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovTestmessage(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *BigMessage) Size() (n int) { - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovTestmessage(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *LargeMessage) Size() (n int) { - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - l = len(s) - n += 1 + l + sovTestmessage(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovTestmessage(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozTestmessage(x uint64) (n int) { - return sovTestmessage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func NewPopulatedSmallMessage(r randyTestmessage, easy bool) *SmallMessage { - this := &SmallMessage{} - if r.Intn(10) != 0 { - v1 := r.Intn(10) - this.Values = make([]string, v1) - for i := 0; i < v1; i++ { - this.Values[i] = randStringTestmessage(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTestmessage(r, 2) - } - return this -} - -func NewPopulatedMediumMessage(r randyTestmessage, easy bool) *MediumMessage { - this := &MediumMessage{} - if r.Intn(10) != 0 { - v2 := r.Intn(10) - this.Values = make([]string, v2) - for i := 0; i < v2; i++ { - this.Values[i] = randStringTestmessage(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTestmessage(r, 2) - } - return this -} - -func NewPopulatedBigMessage(r randyTestmessage, easy bool) *BigMessage { - this := &BigMessage{} - if r.Intn(10) != 0 { - v3 := r.Intn(10) - this.Values = make([]string, v3) - for i := 0; i < v3; i++ { - this.Values[i] = randStringTestmessage(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTestmessage(r, 2) - } - return this -} - -func NewPopulatedLargeMessage(r randyTestmessage, easy bool) *LargeMessage { - this := &LargeMessage{} - if r.Intn(10) != 0 { - v4 := r.Intn(10) - this.Values = make([]string, v4) - for i := 0; i < v4; i++ { - this.Values[i] = randStringTestmessage(r) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedTestmessage(r, 2) - } - return this -} - -type randyTestmessage interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneTestmessage(r randyTestmessage) rune { - res := rune(r.Uint32() % 1112064) - if 55296 <= res { - res += 2047 - } - return res -} -func randStringTestmessage(r randyTestmessage) string { - v5 := r.Intn(100) - tmps := make([]rune, v5) - for i := 0; i < v5; i++ { - tmps[i] = randUTF8RuneTestmessage(r) - } - return string(tmps) -} -func randUnrecognizedTestmessage(r randyTestmessage, maxFieldNumber int) (data []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - data = randFieldTestmessage(data, r, fieldNumber, wire) - } - return data -} -func randFieldTestmessage(data []byte, r randyTestmessage, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - data = encodeVarintPopulateTestmessage(data, uint64(key)) - v6 := r.Int63() - if r.Intn(2) == 0 { - v6 *= -1 - } - data = encodeVarintPopulateTestmessage(data, uint64(v6)) - case 1: - data = encodeVarintPopulateTestmessage(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - data = encodeVarintPopulateTestmessage(data, uint64(key)) - ll := r.Intn(100) - data = encodeVarintPopulateTestmessage(data, uint64(ll)) - for j := 0; j < ll; j++ { - data = append(data, byte(r.Intn(256))) - } - default: - data = encodeVarintPopulateTestmessage(data, uint64(key)) - data = append(data, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return data -} -func encodeVarintPopulateTestmessage(data []byte, v uint64) []byte { - for v >= 1<<7 { - data = append(data, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - data = append(data, uint8(v)) - return data -} -func (m *SmallMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *SmallMessage) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - data[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *MediumMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *MediumMessage) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - data[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *BigMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *BigMessage) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - data[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func (m *LargeMessage) Marshal() (data []byte, err error) { - size := m.Size() - data = make([]byte, size) - n, err := m.MarshalTo(data) - if err != nil { - return nil, err - } - return data[:n], nil -} - -func (m *LargeMessage) MarshalTo(data []byte) (n int, err error) { - var i int - _ = i - var l int - _ = l - if len(m.Values) > 0 { - for _, s := range m.Values { - data[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - data[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - data[i] = uint8(l) - i++ - i += copy(data[i:], s) - } - } - if m.XXX_unrecognized != nil { - i += copy(data[i:], m.XXX_unrecognized) - } - return i, nil -} - -func encodeFixed64Testmessage(data []byte, offset int, v uint64) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - data[offset+4] = uint8(v >> 32) - data[offset+5] = uint8(v >> 40) - data[offset+6] = uint8(v >> 48) - data[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Testmessage(data []byte, offset int, v uint32) int { - data[offset] = uint8(v) - data[offset+1] = uint8(v >> 8) - data[offset+2] = uint8(v >> 16) - data[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintTestmessage(data []byte, offset int, v uint64) int { - for v >= 1<<7 { - data[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - data[offset] = uint8(v) - return offset + 1 -} -func (this *SmallMessage) GoString() string { - if this == nil { - return "nil" - } - s := strings1.Join([]string{`&testmessage.SmallMessage{` + - `Values:` + fmt2.Sprintf("%#v", this.Values), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *MediumMessage) GoString() string { - if this == nil { - return "nil" - } - s := strings1.Join([]string{`&testmessage.MediumMessage{` + - `Values:` + fmt2.Sprintf("%#v", this.Values), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *BigMessage) GoString() string { - if this == nil { - return "nil" - } - s := strings1.Join([]string{`&testmessage.BigMessage{` + - `Values:` + fmt2.Sprintf("%#v", this.Values), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func (this *LargeMessage) GoString() string { - if this == nil { - return "nil" - } - s := strings1.Join([]string{`&testmessage.LargeMessage{` + - `Values:` + fmt2.Sprintf("%#v", this.Values), - `XXX_unrecognized:` + fmt2.Sprintf("%#v", this.XXX_unrecognized) + `}`}, ", ") - return s -} -func valueToGoStringTestmessage(v interface{}, typ string) string { - rv := reflect1.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect1.Indirect(rv).Interface() - return fmt2.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) -} -func extensionToGoStringTestmessage(e map[int32]github_com_gogo_protobuf_proto1.Extension) string { - if e == nil { - return "nil" - } - s := "map[int32]proto.Extension{" - keys := make([]int, 0, len(e)) - for k := range e { - keys = append(keys, int(k)) - } - sort.Ints(keys) - ss := []string{} - for _, k := range keys { - ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) - } - s += strings1.Join(ss, ",") + "}" - return s -} -func (this *SmallMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*SmallMessage) - if !ok { - return fmt3.Errorf("that is not of type *SmallMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *SmallMessage but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *SmallMessagebut is not nil && this == nil") - } - if len(this.Values) != len(that1.Values) { - return fmt3.Errorf("Values this(%v) Not Equal that(%v)", len(this.Values), len(that1.Values)) - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return fmt3.Errorf("Values this[%v](%v) Not Equal that[%v](%v)", i, this.Values[i], i, that1.Values[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *SmallMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*SmallMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *MediumMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*MediumMessage) - if !ok { - return fmt3.Errorf("that is not of type *MediumMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *MediumMessage but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *MediumMessagebut is not nil && this == nil") - } - if len(this.Values) != len(that1.Values) { - return fmt3.Errorf("Values this(%v) Not Equal that(%v)", len(this.Values), len(that1.Values)) - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return fmt3.Errorf("Values this[%v](%v) Not Equal that[%v](%v)", i, this.Values[i], i, that1.Values[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *MediumMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*MediumMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *BigMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*BigMessage) - if !ok { - return fmt3.Errorf("that is not of type *BigMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *BigMessage but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *BigMessagebut is not nil && this == nil") - } - if len(this.Values) != len(that1.Values) { - return fmt3.Errorf("Values this(%v) Not Equal that(%v)", len(this.Values), len(that1.Values)) - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return fmt3.Errorf("Values this[%v](%v) Not Equal that[%v](%v)", i, this.Values[i], i, that1.Values[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *BigMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*BigMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LargeMessage) VerboseEqual(that interface{}) error { - if that == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that == nil && this != nil") - } - - that1, ok := that.(*LargeMessage) - if !ok { - return fmt3.Errorf("that is not of type *LargeMessage") - } - if that1 == nil { - if this == nil { - return nil - } - return fmt3.Errorf("that is type *LargeMessage but is nil && this != nil") - } else if this == nil { - return fmt3.Errorf("that is type *LargeMessagebut is not nil && this == nil") - } - if len(this.Values) != len(that1.Values) { - return fmt3.Errorf("Values this(%v) Not Equal that(%v)", len(this.Values), len(that1.Values)) - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return fmt3.Errorf("Values this[%v](%v) Not Equal that[%v](%v)", i, this.Values[i], i, that1.Values[i]) - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return fmt3.Errorf("XXX_unrecognized this(%v) Not Equal that(%v)", this.XXX_unrecognized, that1.XXX_unrecognized) - } - return nil -} -func (this *LargeMessage) Equal(that interface{}) bool { - if that == nil { - if this == nil { - return true - } - return false - } - - that1, ok := that.(*LargeMessage) - if !ok { - return false - } - if that1 == nil { - if this == nil { - return true - } - return false - } else if this == nil { - return false - } - if len(this.Values) != len(that1.Values) { - return false - } - for i := range this.Values { - if this.Values[i] != that1.Values[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} diff --git a/vendor/github.com/mesos/mesos-go/messenger/testmessage/testmessage.proto b/vendor/github.com/mesos/mesos-go/messenger/testmessage/testmessage.proto deleted file mode 100644 index b1fa57fbdec..00000000000 --- a/vendor/github.com/mesos/mesos-go/messenger/testmessage/testmessage.proto +++ /dev/null @@ -1,31 +0,0 @@ -package testmessage; - -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.gostring_all) = true; -option (gogoproto.equal_all) = true; -option (gogoproto.verbose_equal_all) = true; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = true; -option (gogoproto.populate_all) = true; -option (gogoproto.testgen_all) = false; -option (gogoproto.benchgen_all) = false; -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; - -message SmallMessage { - repeated string Values = 1; -} - -message MediumMessage { - repeated string Values = 1; -} - -message BigMessage { - repeated string Values = 1; -} - -message LargeMessage { - repeated string Values = 1; -} diff --git a/vendor/github.com/mesos/mesos-go/scheduler/mock/scheduler.go b/vendor/github.com/mesos/mesos-go/scheduler/mock/scheduler.go deleted file mode 100644 index cb0f7f29040..00000000000 --- a/vendor/github.com/mesos/mesos-go/scheduler/mock/scheduler.go +++ /dev/null @@ -1,58 +0,0 @@ -package mock - -import ( - log "github.com/golang/glog" - mesos "github.com/mesos/mesos-go/mesosproto" - "github.com/stretchr/testify/mock" - - . "github.com/mesos/mesos-go/scheduler" -) - -type MockScheduler struct { - mock.Mock -} - -func New() *MockScheduler { - return &MockScheduler{} -} - -func (sched *MockScheduler) Registered(SchedulerDriver, *mesos.FrameworkID, *mesos.MasterInfo) { - sched.Called() -} - -func (sched *MockScheduler) Reregistered(SchedulerDriver, *mesos.MasterInfo) { - sched.Called() -} - -func (sched *MockScheduler) Disconnected(SchedulerDriver) { - sched.Called() -} - -func (sched *MockScheduler) ResourceOffers(SchedulerDriver, []*mesos.Offer) { - sched.Called() -} - -func (sched *MockScheduler) OfferRescinded(SchedulerDriver, *mesos.OfferID) { - sched.Called() -} - -func (sched *MockScheduler) StatusUpdate(SchedulerDriver, *mesos.TaskStatus) { - sched.Called() -} - -func (sched *MockScheduler) FrameworkMessage(SchedulerDriver, *mesos.ExecutorID, *mesos.SlaveID, string) { - sched.Called() -} - -func (sched *MockScheduler) SlaveLost(SchedulerDriver, *mesos.SlaveID) { - sched.Called() -} - -func (sched *MockScheduler) ExecutorLost(SchedulerDriver, *mesos.ExecutorID, *mesos.SlaveID, int) { - sched.Called() -} - -func (sched *MockScheduler) Error(d SchedulerDriver, msg string) { - log.Error(msg) - sched.Called() -} diff --git a/vendor/github.com/miekg/dns/idn/punycode.go b/vendor/github.com/miekg/dns/idn/punycode.go deleted file mode 100644 index faab4027b90..00000000000 --- a/vendor/github.com/miekg/dns/idn/punycode.go +++ /dev/null @@ -1,268 +0,0 @@ -// Package idn implements encoding from and to punycode as speficied by RFC 3492. -package idn - -import ( - "bytes" - "github.com/miekg/dns" - "strings" - "unicode" -) - -// Implementation idea from RFC itself and from from IDNA::Punycode created by -// Tatsuhiko Miyagawa and released under Perl Artistic -// License in 2002. - -const ( - _MIN rune = 1 - _MAX rune = 26 - _SKEW rune = 38 - _BASE rune = 36 - _BIAS rune = 72 - _N rune = 128 - _DAMP rune = 700 - - _DELIMITER = '-' - _PREFIX = "xn--" -) - -// ToPunycode converts unicode domain names to DNS-appropriate punycode names. -// This function would return incorrect result for strings for non-canonical -// unicode strings. -func ToPunycode(s string) string { - tokens := dns.SplitDomainName(s) - switch { - case s == "": - return "" - case tokens == nil: // s == . - return "." - case s[len(s)-1] == '.': - tokens = append(tokens, "") - } - - for i := range tokens { - tokens[i] = string(encode([]byte(tokens[i]))) - } - return strings.Join(tokens, ".") -} - -// FromPunycode returns unicode domain name from provided punycode string. -func FromPunycode(s string) string { - tokens := dns.SplitDomainName(s) - switch { - case s == "": - return "" - case tokens == nil: // s == . - return "." - case s[len(s)-1] == '.': - tokens = append(tokens, "") - } - for i := range tokens { - tokens[i] = string(decode([]byte(tokens[i]))) - } - return strings.Join(tokens, ".") -} - -// digitval converts single byte into meaningful value that's used to calculate decoded unicode character. -const errdigit = 0xffff - -func digitval(code rune) rune { - switch { - case code >= 'A' && code <= 'Z': - return code - 'A' - case code >= 'a' && code <= 'z': - return code - 'a' - case code >= '0' && code <= '9': - return code - '0' + 26 - } - return errdigit -} - -// lettercode finds BASE36 byte (a-z0-9) based on calculated number. -func lettercode(digit rune) rune { - switch { - case digit >= 0 && digit <= 25: - return digit + 'a' - case digit >= 26 && digit <= 36: - return digit - 26 + '0' - } - panic("dns: not reached") -} - -// adapt calculates next bias to be used for next iteration delta. -func adapt(delta rune, numpoints int, firsttime bool) rune { - if firsttime { - delta /= _DAMP - } else { - delta /= 2 - } - - var k rune - for delta = delta + delta/rune(numpoints); delta > (_BASE-_MIN)*_MAX/2; k += _BASE { - delta /= _BASE - _MIN - } - - return k + ((_BASE-_MIN+1)*delta)/(delta+_SKEW) -} - -// next finds minimal rune (one with lowest codepoint value) that should be equal or above boundary. -func next(b []rune, boundary rune) rune { - if len(b) == 0 { - panic("dns: invalid set of runes to determine next one") - } - m := b[0] - for _, x := range b[1:] { - if x >= boundary && (m < boundary || x < m) { - m = x - } - } - return m -} - -// preprune converts unicode rune to lower case. At this time it's not -// supporting all things described in RFCs -func preprune(r rune) rune { - if unicode.IsUpper(r) { - r = unicode.ToLower(r) - } - return r -} - -// tfunc is a function that helps calculate each character weight -func tfunc(k, bias rune) rune { - switch { - case k <= bias: - return _MIN - case k >= bias+_MAX: - return _MAX - } - return k - bias -} - -// encode transforms Unicode input bytes (that represent DNS label) into punycode bytestream -func encode(input []byte) []byte { - n, bias := _N, _BIAS - - b := bytes.Runes(input) - for i := range b { - b[i] = preprune(b[i]) - } - - basic := make([]byte, 0, len(b)) - for _, ltr := range b { - if ltr <= 0x7f { - basic = append(basic, byte(ltr)) - } - } - basiclen := len(basic) - fulllen := len(b) - if basiclen == fulllen { - return basic - } - - var out bytes.Buffer - - out.WriteString(_PREFIX) - if basiclen > 0 { - out.Write(basic) - out.WriteByte(_DELIMITER) - } - - var ( - ltr, nextltr rune - delta, q rune // delta calculation (see rfc) - t, k, cp rune // weight and codepoint calculation - ) - - s := &bytes.Buffer{} - for h := basiclen; h < fulllen; n, delta = n+1, delta+1 { - nextltr = next(b, n) - s.Truncate(0) - s.WriteRune(nextltr) - delta, n = delta+(nextltr-n)*rune(h+1), nextltr - - for _, ltr = range b { - if ltr < n { - delta++ - } - if ltr == n { - q = delta - for k = _BASE; ; k += _BASE { - t = tfunc(k, bias) - if q < t { - break - } - cp = t + ((q - t) % (_BASE - t)) - out.WriteRune(lettercode(cp)) - q = (q - t) / (_BASE - t) - } - - out.WriteRune(lettercode(q)) - - bias = adapt(delta, h+1, h == basiclen) - h, delta = h+1, 0 - } - } - } - return out.Bytes() -} - -// decode transforms punycode input bytes (that represent DNS label) into Unicode bytestream -func decode(b []byte) []byte { - src := b // b would move and we need to keep it - - n, bias := _N, _BIAS - if !bytes.HasPrefix(b, []byte(_PREFIX)) { - return b - } - out := make([]rune, 0, len(b)) - b = b[len(_PREFIX):] - for pos, x := range b { - if x == _DELIMITER { - out = append(out, bytes.Runes(b[:pos])...) - b = b[pos+1:] // trim source string - break - } - } - if len(b) == 0 { - return src - } - var ( - i, oldi, w rune - ch byte - t, digit rune - ln int - ) - - for i = 0; len(b) > 0; i++ { - oldi, w = i, 1 - for k := _BASE; len(b) > 0; k += _BASE { - ch, b = b[0], b[1:] - digit = digitval(rune(ch)) - if digit == errdigit { - return src - } - i += digit * w - - t = tfunc(k, bias) - if digit < t { - break - } - - w *= _BASE - t - } - ln = len(out) + 1 - bias = adapt(i-oldi, ln, oldi == 0) - n += i / rune(ln) - i = i % rune(ln) - // insert - out = append(out, 0) - copy(out[i+1:], out[i:]) - out[i] = n - } - - var ret bytes.Buffer - for _, r := range out { - ret.WriteRune(r) - } - return ret.Bytes() -} diff --git a/vendor/github.com/mvdan/xurls/cmd/xurls/main.go b/vendor/github.com/mvdan/xurls/cmd/xurls/main.go deleted file mode 100644 index 7fa00f0c826..00000000000 --- a/vendor/github.com/mvdan/xurls/cmd/xurls/main.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2015, Daniel Martí -// See LICENSE for licensing information - -package main - -import ( - "bufio" - "flag" - "fmt" - "os" - "regexp" - - "github.com/mvdan/xurls" -) - -var ( - matching = flag.String("m", "", "") - relaxed = flag.Bool("r", false, "") -) - -func init() { - flag.Usage = func() { - p := func(format string, a ...interface{}) { - fmt.Fprintf(os.Stderr, format, a...) - } - p("Usage: xurls [-h] [files]\n\n") - p("If no files are given, it reads from standard input.\n\n") - p(" -m only match urls whose scheme matches a regexp\n") - p(" example: 'https?://|mailto:'\n") - p(" -r also match urls without a scheme (relaxed)\n") - } -} - -func scanPath(re *regexp.Regexp, path string) error { - r := os.Stdin - if path != "-" { - f, err := os.Open(path) - if err != nil { - return err - } - defer f.Close() - r = f - } - scanner := bufio.NewScanner(r) - scanner.Split(bufio.ScanWords) - for scanner.Scan() { - word := scanner.Text() - for _, match := range re.FindAllString(word, -1) { - fmt.Println(match) - } - } - return scanner.Err() -} - -func main() { - flag.Parse() - if *relaxed && *matching != "" { - errExit(fmt.Errorf("-r and -m at the same time don't make much sense")) - } - re := xurls.Strict - if *relaxed { - re = xurls.Relaxed - } else if *matching != "" { - var err error - if re, err = xurls.StrictMatchingScheme(*matching); err != nil { - errExit(err) - } - } - args := flag.Args() - if len(args) == 0 { - args = []string{"-"} - } - for _, path := range args { - if err := scanPath(re, path); err != nil { - errExit(err) - } - } -} - -func errExit(err error) { - fmt.Fprintf(os.Stderr, "%v\n", err) - os.Exit(1) -} diff --git a/vendor/github.com/mvdan/xurls/generate/regexgen/main.go b/vendor/github.com/mvdan/xurls/generate/regexgen/main.go deleted file mode 100644 index 2574e9bcf8e..00000000000 --- a/vendor/github.com/mvdan/xurls/generate/regexgen/main.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) 2015, Daniel Martí -// See LICENSE for licensing information - -package main - -import ( - "log" - "os" - "sort" - "strings" - "text/template" - - "golang.org/x/net/idna" - - "github.com/mvdan/xurls" -) - -const path = "regex.go" - -var regexTmpl = template.Must(template.New("regex").Parse(`// Generated by regexgen - -package xurls - -const ({{ range $key, $value := . }} - {{$key}} = ` + "`" + `{{$value}}` + "`" + `{{end}} -) -`)) - -func writeRegex(tlds []string) error { - allTldsSet := make(map[string]struct{}) - add := func(tld string) { - if _, e := allTldsSet[tld]; e { - log.Fatalf("Duplicate TLD: %s", tld) - } - allTldsSet[tld] = struct{}{} - } - for _, tldlist := range [...][]string{tlds, xurls.PseudoTLDs} { - for _, tld := range tldlist { - add(tld) - asciiTld, err := idna.ToASCII(tld) - if err != nil { - return err - } - if asciiTld != tld { - add(asciiTld) - } - } - } - var allTlds []string - for tld := range allTldsSet { - allTlds = append(allTlds, tld) - } - sort.Strings(allTlds) - f, err := os.Create(path) - if err != nil { - return err - } - defer f.Close() - return regexTmpl.Execute(f, map[string]string{ - "gtld ": `(?i)(` + strings.Join(allTlds, `|`) + `)(?-i)`, - "otherScheme": `(?i)(` + strings.Join(xurls.SchemesNoAuthority, `|`) + `)(?-i):`, - }) -} - -func main() { - log.Printf("Generating %s...", path) - if err := writeRegex(xurls.TLDs); err != nil { - log.Fatalf("Could not write %s: %v", path, err) - } -} diff --git a/vendor/github.com/mvdan/xurls/generate/tldsgen/main.go b/vendor/github.com/mvdan/xurls/generate/tldsgen/main.go deleted file mode 100644 index 4453a038069..00000000000 --- a/vendor/github.com/mvdan/xurls/generate/tldsgen/main.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) 2015, Daniel Martí -// See LICENSE for licensing information - -package main - -import ( - "bufio" - "errors" - "log" - "net/http" - "os" - "regexp" - "sort" - "strings" - "sync" - "text/template" -) - -const path = "tlds.go" - -var tldsTmpl = template.Must(template.New("tlds").Parse(`// Generated by tldsgen - -package xurls - -// TLDs is a sorted list of all public top-level domains. -// -// Sources:{{range $_, $url := .URLs}} -// * {{$url}}{{end}} -var TLDs = []string{ -{{range $_, $tld := .TLDs}}` + "\t`" + `{{$tld}}` + "`" + `, -{{end}}} -`)) - -func cleanTld(tld string) string { - tld = strings.ToLower(tld) - if strings.HasPrefix(tld, "xn--") { - return "" - } - return tld -} - -func fetchFromURL(url, pat string) { - defer wg.Done() - log.Printf("Fetching %s", url) - resp, err := http.Get(url) - if err == nil && resp.StatusCode >= 400 { - err = errors.New(resp.Status) - } - if err != nil { - errChan <- err - return - } - defer resp.Body.Close() - scanner := bufio.NewScanner(resp.Body) - re := regexp.MustCompile(pat) - for scanner.Scan() { - line := scanner.Text() - tld := re.FindString(line) - tld = cleanTld(tld) - if tld == "" { - continue - } - tldChan <- tld - } - if err := scanner.Err(); err != nil { - errChan <- err - } -} - -var ( - wg sync.WaitGroup - tldChan = make(chan string) - errChan = make(chan error) -) - -func tldList() ([]string, []string, error) { - var urls []string - fromURL := func(url, pat string) { - urls = append(urls, url) - wg.Add(1) - go fetchFromURL(url, pat) - } - fromURL("https://data.iana.org/TLD/tlds-alpha-by-domain.txt", - `^[^#]+$`) - fromURL("https://publicsuffix.org/list/effective_tld_names.dat", - `^[^/.]+$`) - - tldSet := make(map[string]struct{}) - anyError := false - go func() { - for { - select { - case tld := <-tldChan: - tldSet[tld] = struct{}{} - case err := <-errChan: - log.Printf("%v", err) - anyError = true - } - } - }() - wg.Wait() - - if anyError { - return nil, nil, errors.New("there were some errors while fetching the TLDs") - } - - tlds := make([]string, 0, len(tldSet)) - for tld := range tldSet { - tlds = append(tlds, tld) - } - - sort.Strings(tlds) - return tlds, urls, nil -} - -func writeTlds(tlds, urls []string) error { - f, err := os.Create(path) - if err != nil { - return err - } - defer f.Close() - return tldsTmpl.Execute(f, struct { - TLDs []string - URLs []string - }{ - TLDs: tlds, - URLs: urls, - }) -} - -func main() { - tlds, urls, err := tldList() - if err != nil { - log.Fatalf("Could not get TLD list: %v", err) - } - log.Printf("Generating %s...", path) - if err := writeTlds(tlds, urls); err != nil { - log.Fatalf("Could not write path: %v", err) - } -} diff --git a/vendor/github.com/onsi/ginkgo/extensions/table/table.go b/vendor/github.com/onsi/ginkgo/extensions/table/table.go deleted file mode 100644 index ae8ab7d248f..00000000000 --- a/vendor/github.com/onsi/ginkgo/extensions/table/table.go +++ /dev/null @@ -1,98 +0,0 @@ -/* - -Table provides a simple DSL for Ginkgo-native Table-Driven Tests - -The godoc documentation describes Table's API. More comprehensive documentation (with examples!) is available at http://onsi.github.io/ginkgo#table-driven-tests - -*/ - -package table - -import ( - "fmt" - "reflect" - - "github.com/onsi/ginkgo" -) - -/* -DescribeTable describes a table-driven test. - -For example: - - DescribeTable("a simple table", - func(x int, y int, expected bool) { - Ω(x > y).Should(Equal(expected)) - }, - Entry("x > y", 1, 0, true), - Entry("x == y", 0, 0, false), - Entry("x < y", 0, 1, false), - ) - -The first argument to `DescribeTable` is a string description. -The second argument is a function that will be run for each table entry. Your assertions go here - the function is equivalent to a Ginkgo It. -The subsequent arguments must be of type `TableEntry`. We recommend using the `Entry` convenience constructors. - -The `Entry` constructor takes a string description followed by an arbitrary set of parameters. These parameters are passed into your function. - -Under the hood, `DescribeTable` simply generates a new Ginkgo `Describe`. Each `Entry` is turned into an `It` within the `Describe`. - -It's important to understand that the `Describe`s and `It`s are generated at evaluation time (i.e. when Ginkgo constructs the tree of tests and before the tests run). - -Individual Entries can be focused (with FEntry) or marked pending (with PEntry or XEntry). In addition, the entire table can be focused or marked pending with FDescribeTable and PDescribeTable/XDescribeTable. -*/ -func DescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { - describeTable(description, itBody, entries, false, false) - return true -} - -/* -You can focus a table with `FDescribeTable`. This is equivalent to `FDescribe`. -*/ -func FDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { - describeTable(description, itBody, entries, false, true) - return true -} - -/* -You can mark a table as pending with `PDescribeTable`. This is equivalent to `PDescribe`. -*/ -func PDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { - describeTable(description, itBody, entries, true, false) - return true -} - -/* -You can mark a table as pending with `XDescribeTable`. This is equivalent to `XDescribe`. -*/ -func XDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { - describeTable(description, itBody, entries, true, false) - return true -} - -func describeTable(description string, itBody interface{}, entries []TableEntry, pending bool, focused bool) { - itBodyValue := reflect.ValueOf(itBody) - if itBodyValue.Kind() != reflect.Func { - panic(fmt.Sprintf("DescribeTable expects a function, got %#v", itBody)) - } - - if pending { - ginkgo.PDescribe(description, func() { - for _, entry := range entries { - entry.generateIt(itBodyValue) - } - }) - } else if focused { - ginkgo.FDescribe(description, func() { - for _, entry := range entries { - entry.generateIt(itBodyValue) - } - }) - } else { - ginkgo.Describe(description, func() { - for _, entry := range entries { - entry.generateIt(itBodyValue) - } - }) - } -} diff --git a/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go b/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go deleted file mode 100644 index 5fa645bceee..00000000000 --- a/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go +++ /dev/null @@ -1,81 +0,0 @@ -package table - -import ( - "reflect" - - "github.com/onsi/ginkgo" -) - -/* -TableEntry represents an entry in a table test. You generally use the `Entry` constructor. -*/ -type TableEntry struct { - Description string - Parameters []interface{} - Pending bool - Focused bool -} - -func (t TableEntry) generateIt(itBody reflect.Value) { - if t.Pending { - ginkgo.PIt(t.Description) - return - } - - values := []reflect.Value{} - for i, param := range t.Parameters { - var value reflect.Value - - if param == nil { - inType := itBody.Type().In(i) - value = reflect.Zero(inType) - } else { - value = reflect.ValueOf(param) - } - - values = append(values, value) - } - - body := func() { - itBody.Call(values) - } - - if t.Focused { - ginkgo.FIt(t.Description, body) - } else { - ginkgo.It(t.Description, body) - } -} - -/* -Entry constructs a TableEntry. - -The first argument is a required description (this becomes the content of the generated Ginkgo `It`). -Subsequent parameters are saved off and sent to the callback passed in to `DescribeTable`. - -Each Entry ends up generating an individual Ginkgo It. -*/ -func Entry(description string, parameters ...interface{}) TableEntry { - return TableEntry{description, parameters, false, false} -} - -/* -You can focus a particular entry with FEntry. This is equivalent to FIt. -*/ -func FEntry(description string, parameters ...interface{}) TableEntry { - return TableEntry{description, parameters, false, true} -} - -/* -You can mark a particular entry as pending with PEntry. This is equivalent to PIt. -*/ -func PEntry(description string, parameters ...interface{}) TableEntry { - return TableEntry{description, parameters, true, false} -} - -/* -You can mark a particular entry as pending with XEntry. This is equivalent to XIt. -*/ -func XEntry(description string, parameters ...interface{}) TableEntry { - return TableEntry{description, parameters, true, false} -} diff --git a/vendor/github.com/onsi/ginkgo/integration/integration.go b/vendor/github.com/onsi/ginkgo/integration/integration.go deleted file mode 100644 index 76ab1b7282d..00000000000 --- a/vendor/github.com/onsi/ginkgo/integration/integration.go +++ /dev/null @@ -1 +0,0 @@ -package integration diff --git a/vendor/github.com/onsi/gomega/gbytes/buffer.go b/vendor/github.com/onsi/gomega/gbytes/buffer.go deleted file mode 100644 index 8775b8611a0..00000000000 --- a/vendor/github.com/onsi/gomega/gbytes/buffer.go +++ /dev/null @@ -1,229 +0,0 @@ -/* -Package gbytes provides a buffer that supports incrementally detecting input. - -You use gbytes.Buffer with the gbytes.Say matcher. When Say finds a match, it fastforwards the buffer's read cursor to the end of that match. - -Subsequent matches against the buffer will only operate against data that appears *after* the read cursor. - -The read cursor is an opaque implementation detail that you cannot access. You should use the Say matcher to sift through the buffer. You can always -access the entire buffer's contents with Contents(). - -*/ -package gbytes - -import ( - "errors" - "fmt" - "io" - "regexp" - "sync" - "time" -) - -/* -gbytes.Buffer implements an io.Writer and can be used with the gbytes.Say matcher. - -You should only use a gbytes.Buffer in test code. It stores all writes in an in-memory buffer - behavior that is inappropriate for production code! -*/ -type Buffer struct { - contents []byte - readCursor uint64 - lock *sync.Mutex - detectCloser chan interface{} - closed bool -} - -/* -NewBuffer returns a new gbytes.Buffer -*/ -func NewBuffer() *Buffer { - return &Buffer{ - lock: &sync.Mutex{}, - } -} - -/* -BufferWithBytes returns a new gbytes.Buffer seeded with the passed in bytes -*/ -func BufferWithBytes(bytes []byte) *Buffer { - return &Buffer{ - lock: &sync.Mutex{}, - contents: bytes, - } -} - -/* -Write implements the io.Writer interface -*/ -func (b *Buffer) Write(p []byte) (n int, err error) { - b.lock.Lock() - defer b.lock.Unlock() - - if b.closed { - return 0, errors.New("attempt to write to closed buffer") - } - - b.contents = append(b.contents, p...) - return len(p), nil -} - -/* -Read implements the io.Reader interface. It advances the -cursor as it reads. - -Returns an error if called after Close. -*/ -func (b *Buffer) Read(d []byte) (int, error) { - b.lock.Lock() - defer b.lock.Unlock() - - if b.closed { - return 0, errors.New("attempt to read from closed buffer") - } - - if uint64(len(b.contents)) <= b.readCursor { - return 0, io.EOF - } - - n := copy(d, b.contents[b.readCursor:]) - b.readCursor += uint64(n) - - return n, nil -} - -/* -Close signifies that the buffer will no longer be written to -*/ -func (b *Buffer) Close() error { - b.lock.Lock() - defer b.lock.Unlock() - - b.closed = true - - return nil -} - -/* -Closed returns true if the buffer has been closed -*/ -func (b *Buffer) Closed() bool { - b.lock.Lock() - defer b.lock.Unlock() - - return b.closed -} - -/* -Contents returns all data ever written to the buffer. -*/ -func (b *Buffer) Contents() []byte { - b.lock.Lock() - defer b.lock.Unlock() - - contents := make([]byte, len(b.contents)) - copy(contents, b.contents) - return contents -} - -/* -Detect takes a regular expression and returns a channel. - -The channel will receive true the first time data matching the regular expression is written to the buffer. -The channel is subsequently closed and the buffer's read-cursor is fast-forwarded to just after the matching region. - -You typically don't need to use Detect and should use the ghttp.Say matcher instead. Detect is useful, however, in cases where your code must -be branch and handle different outputs written to the buffer. - -For example, consider a buffer hooked up to the stdout of a client library. You may (or may not, depending on state outside of your control) need to authenticate the client library. - -You could do something like: - -select { -case <-buffer.Detect("You are not logged in"): - //log in -case <-buffer.Detect("Success"): - //carry on -case <-time.After(time.Second): - //welp -} -buffer.CancelDetects() - -You should always call CancelDetects after using Detect. This will close any channels that have not detected and clean up the goroutines that were spawned to support them. - -Finally, you can pass detect a format string followed by variadic arguments. This will construct the regexp using fmt.Sprintf. -*/ -func (b *Buffer) Detect(desired string, args ...interface{}) chan bool { - formattedRegexp := desired - if len(args) > 0 { - formattedRegexp = fmt.Sprintf(desired, args...) - } - re := regexp.MustCompile(formattedRegexp) - - b.lock.Lock() - defer b.lock.Unlock() - - if b.detectCloser == nil { - b.detectCloser = make(chan interface{}) - } - - closer := b.detectCloser - response := make(chan bool) - go func() { - ticker := time.NewTicker(10 * time.Millisecond) - defer ticker.Stop() - defer close(response) - for { - select { - case <-ticker.C: - b.lock.Lock() - data, cursor := b.contents[b.readCursor:], b.readCursor - loc := re.FindIndex(data) - b.lock.Unlock() - - if loc != nil { - response <- true - b.lock.Lock() - newCursorPosition := cursor + uint64(loc[1]) - if newCursorPosition >= b.readCursor { - b.readCursor = newCursorPosition - } - b.lock.Unlock() - return - } - case <-closer: - return - } - } - }() - - return response -} - -/* -CancelDetects cancels any pending detects and cleans up their goroutines. You should always call this when you're done with a set of Detect channels. -*/ -func (b *Buffer) CancelDetects() { - b.lock.Lock() - defer b.lock.Unlock() - - close(b.detectCloser) - b.detectCloser = nil -} - -func (b *Buffer) didSay(re *regexp.Regexp) (bool, []byte) { - b.lock.Lock() - defer b.lock.Unlock() - - unreadBytes := b.contents[b.readCursor:] - copyOfUnreadBytes := make([]byte, len(unreadBytes)) - copy(copyOfUnreadBytes, unreadBytes) - - loc := re.FindIndex(unreadBytes) - - if loc != nil { - b.readCursor += uint64(loc[1]) - return true, copyOfUnreadBytes - } else { - return false, copyOfUnreadBytes - } -} diff --git a/vendor/github.com/onsi/gomega/gbytes/say_matcher.go b/vendor/github.com/onsi/gomega/gbytes/say_matcher.go deleted file mode 100644 index ce5ebcbfa59..00000000000 --- a/vendor/github.com/onsi/gomega/gbytes/say_matcher.go +++ /dev/null @@ -1,105 +0,0 @@ -package gbytes - -import ( - "fmt" - "regexp" - - "github.com/onsi/gomega/format" -) - -//Objects satisfying the BufferProvider can be used with the Say matcher. -type BufferProvider interface { - Buffer() *Buffer -} - -/* -Say is a Gomega matcher that operates on gbytes.Buffers: - - Ω(buffer).Should(Say("something")) - -will succeed if the unread portion of the buffer matches the regular expression "something". - -When Say succeeds, it fast forwards the gbytes.Buffer's read cursor to just after the succesful match. -Thus, subsequent calls to Say will only match against the unread portion of the buffer - -Say pairs very well with Eventually. To asser that a buffer eventually receives data matching "[123]-star" within 3 seconds you can: - - Eventually(buffer, 3).Should(Say("[123]-star")) - -Ditto with consistently. To assert that a buffer does not receive data matching "never-see-this" for 1 second you can: - - Consistently(buffer, 1).ShouldNot(Say("never-see-this")) - -In addition to bytes.Buffers, Say can operate on objects that implement the gbytes.BufferProvider interface. -In such cases, Say simply operates on the *gbytes.Buffer returned by Buffer() - -If the buffer is closed, the Say matcher will tell Eventually to abort. -*/ -func Say(expected string, args ...interface{}) *sayMatcher { - formattedRegexp := expected - if len(args) > 0 { - formattedRegexp = fmt.Sprintf(expected, args...) - } - return &sayMatcher{ - re: regexp.MustCompile(formattedRegexp), - } -} - -type sayMatcher struct { - re *regexp.Regexp - receivedSayings []byte -} - -func (m *sayMatcher) buffer(actual interface{}) (*Buffer, bool) { - var buffer *Buffer - - switch x := actual.(type) { - case *Buffer: - buffer = x - case BufferProvider: - buffer = x.Buffer() - default: - return nil, false - } - - return buffer, true -} - -func (m *sayMatcher) Match(actual interface{}) (success bool, err error) { - buffer, ok := m.buffer(actual) - if !ok { - return false, fmt.Errorf("Say must be passed a *gbytes.Buffer or BufferProvider. Got:\n%s", format.Object(actual, 1)) - } - - didSay, sayings := buffer.didSay(m.re) - m.receivedSayings = sayings - - return didSay, nil -} - -func (m *sayMatcher) FailureMessage(actual interface{}) (message string) { - return fmt.Sprintf( - "Got stuck at:\n%s\nWaiting for:\n%s", - format.IndentString(string(m.receivedSayings), 1), - format.IndentString(m.re.String(), 1), - ) -} - -func (m *sayMatcher) NegatedFailureMessage(actual interface{}) (message string) { - return fmt.Sprintf( - "Saw:\n%s\nWhich matches the unexpected:\n%s", - format.IndentString(string(m.receivedSayings), 1), - format.IndentString(m.re.String(), 1), - ) -} - -func (m *sayMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { - switch x := actual.(type) { - case *Buffer: - return !x.Closed() - case BufferProvider: - return !x.Buffer().Closed() - default: - return true - } -} diff --git a/vendor/github.com/onsi/gomega/gexec/build.go b/vendor/github.com/onsi/gomega/gexec/build.go deleted file mode 100644 index 3e9bf9f9478..00000000000 --- a/vendor/github.com/onsi/gomega/gexec/build.go +++ /dev/null @@ -1,78 +0,0 @@ -package gexec - -import ( - "errors" - "fmt" - "io/ioutil" - "os" - "os/exec" - "path" - "path/filepath" - "runtime" -) - -var tmpDir string - -/* -Build uses go build to compile the package at packagePath. The resulting binary is saved off in a temporary directory. -A path pointing to this binary is returned. - -Build uses the $GOPATH set in your environment. It passes the variadic args on to `go build`. -*/ -func Build(packagePath string, args ...string) (compiledPath string, err error) { - return BuildIn(os.Getenv("GOPATH"), packagePath, args...) -} - -/* -BuildIn is identical to Build but allows you to specify a custom $GOPATH (the first argument). -*/ -func BuildIn(gopath string, packagePath string, args ...string) (compiledPath string, err error) { - tmpDir, err := temporaryDirectory() - if err != nil { - return "", err - } - - if len(gopath) == 0 { - return "", errors.New("$GOPATH not provided when building " + packagePath) - } - - executable := filepath.Join(tmpDir, path.Base(packagePath)) - if runtime.GOOS == "windows" { - executable = executable + ".exe" - } - - cmdArgs := append([]string{"build"}, args...) - cmdArgs = append(cmdArgs, "-o", executable, packagePath) - - build := exec.Command("go", cmdArgs...) - build.Env = append([]string{"GOPATH=" + gopath}, os.Environ()...) - - output, err := build.CombinedOutput() - if err != nil { - return "", fmt.Errorf("Failed to build %s:\n\nError:\n%s\n\nOutput:\n%s", packagePath, err, string(output)) - } - - return executable, nil -} - -/* -You should call CleanupBuildArtifacts before your test ends to clean up any temporary artifacts generated by -gexec. In Ginkgo this is typically done in an AfterSuite callback. -*/ -func CleanupBuildArtifacts() { - if tmpDir != "" { - os.RemoveAll(tmpDir) - } -} - -func temporaryDirectory() (string, error) { - var err error - if tmpDir == "" { - tmpDir, err = ioutil.TempDir("", "gexec_artifacts") - if err != nil { - return "", err - } - } - - return ioutil.TempDir(tmpDir, "g") -} diff --git a/vendor/github.com/onsi/gomega/gexec/exit_matcher.go b/vendor/github.com/onsi/gomega/gexec/exit_matcher.go deleted file mode 100644 index e6f43294270..00000000000 --- a/vendor/github.com/onsi/gomega/gexec/exit_matcher.go +++ /dev/null @@ -1,88 +0,0 @@ -package gexec - -import ( - "fmt" - - "github.com/onsi/gomega/format" -) - -/* -The Exit matcher operates on a session: - - Ω(session).Should(Exit()) - -Exit passes if the session has already exited. - -If no status code is provided, then Exit will succeed if the session has exited regardless of exit code. -Otherwise, Exit will only succeed if the process has exited with the provided status code. - -Note that the process must have already exited. To wait for a process to exit, use Eventually: - - Eventually(session, 3).Should(Exit(0)) -*/ -func Exit(optionalExitCode ...int) *exitMatcher { - exitCode := -1 - if len(optionalExitCode) > 0 { - exitCode = optionalExitCode[0] - } - - return &exitMatcher{ - exitCode: exitCode, - } -} - -type exitMatcher struct { - exitCode int - didExit bool - actualExitCode int -} - -type Exiter interface { - ExitCode() int -} - -func (m *exitMatcher) Match(actual interface{}) (success bool, err error) { - exiter, ok := actual.(Exiter) - if !ok { - return false, fmt.Errorf("Exit must be passed a gexec.Exiter (Missing method ExitCode() int) Got:\n%s", format.Object(actual, 1)) - } - - m.actualExitCode = exiter.ExitCode() - - if m.actualExitCode == -1 { - return false, nil - } - - if m.exitCode == -1 { - return true, nil - } - return m.exitCode == m.actualExitCode, nil -} - -func (m *exitMatcher) FailureMessage(actual interface{}) (message string) { - if m.actualExitCode == -1 { - return "Expected process to exit. It did not." - } else { - return format.Message(m.actualExitCode, "to match exit code:", m.exitCode) - } -} - -func (m *exitMatcher) NegatedFailureMessage(actual interface{}) (message string) { - if m.actualExitCode == -1 { - return "you really shouldn't be able to see this!" - } else { - if m.exitCode == -1 { - return "Expected process not to exit. It did." - } else { - return format.Message(m.actualExitCode, "not to match exit code:", m.exitCode) - } - } -} - -func (m *exitMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { - session, ok := actual.(*Session) - if ok { - return session.ExitCode() == -1 - } - return true -} diff --git a/vendor/github.com/onsi/gomega/gexec/prefixed_writer.go b/vendor/github.com/onsi/gomega/gexec/prefixed_writer.go deleted file mode 100644 index 05e695abc8d..00000000000 --- a/vendor/github.com/onsi/gomega/gexec/prefixed_writer.go +++ /dev/null @@ -1,53 +0,0 @@ -package gexec - -import ( - "io" - "sync" -) - -/* -PrefixedWriter wraps an io.Writer, emiting the passed in prefix at the beginning of each new line. -This can be useful when running multiple gexec.Sessions concurrently - you can prefix the log output of each -session by passing in a PrefixedWriter: - -gexec.Start(cmd, NewPrefixedWriter("[my-cmd] ", GinkgoWriter), NewPrefixedWriter("[my-cmd] ", GinkgoWriter)) -*/ -type PrefixedWriter struct { - prefix []byte - writer io.Writer - lock *sync.Mutex - atStartOfLine bool -} - -func NewPrefixedWriter(prefix string, writer io.Writer) *PrefixedWriter { - return &PrefixedWriter{ - prefix: []byte(prefix), - writer: writer, - lock: &sync.Mutex{}, - atStartOfLine: true, - } -} - -func (w *PrefixedWriter) Write(b []byte) (int, error) { - w.lock.Lock() - defer w.lock.Unlock() - - toWrite := []byte{} - - for _, c := range b { - if w.atStartOfLine { - toWrite = append(toWrite, w.prefix...) - } - - toWrite = append(toWrite, c) - - w.atStartOfLine = c == '\n' - } - - _, err := w.writer.Write(toWrite) - if err != nil { - return 0, err - } - - return len(b), nil -} diff --git a/vendor/github.com/onsi/gomega/gexec/session.go b/vendor/github.com/onsi/gomega/gexec/session.go deleted file mode 100644 index 46e712235d8..00000000000 --- a/vendor/github.com/onsi/gomega/gexec/session.go +++ /dev/null @@ -1,214 +0,0 @@ -/* -Package gexec provides support for testing external processes. -*/ -package gexec - -import ( - "io" - "os" - "os/exec" - "reflect" - "sync" - "syscall" - - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" -) - -const INVALID_EXIT_CODE = 254 - -type Session struct { - //The wrapped command - Command *exec.Cmd - - //A *gbytes.Buffer connected to the command's stdout - Out *gbytes.Buffer - - //A *gbytes.Buffer connected to the command's stderr - Err *gbytes.Buffer - - //A channel that will close when the command exits - Exited <-chan struct{} - - lock *sync.Mutex - exitCode int -} - -/* -Start starts the passed-in *exec.Cmd command. It wraps the command in a *gexec.Session. - -The session pipes the command's stdout and stderr to two *gbytes.Buffers available as properties on the session: session.Out and session.Err. -These buffers can be used with the gbytes.Say matcher to match against unread output: - - Ω(session.Out).Should(gbytes.Say("foo-out")) - Ω(session.Err).Should(gbytes.Say("foo-err")) - -In addition, Session satisfies the gbytes.BufferProvider interface and provides the stdout *gbytes.Buffer. This allows you to replace the first line, above, with: - - Ω(session).Should(gbytes.Say("foo-out")) - -When outWriter and/or errWriter are non-nil, the session will pipe stdout and/or stderr output both into the session *gybtes.Buffers and to the passed-in outWriter/errWriter. -This is useful for capturing the process's output or logging it to screen. In particular, when using Ginkgo it can be convenient to direct output to the GinkgoWriter: - - session, err := Start(command, GinkgoWriter, GinkgoWriter) - -This will log output when running tests in verbose mode, but - otherwise - will only log output when a test fails. - -The session wrapper is responsible for waiting on the *exec.Cmd command. You *should not* call command.Wait() yourself. -Instead, to assert that the command has exited you can use the gexec.Exit matcher: - - Ω(session).Should(gexec.Exit()) - -When the session exits it closes the stdout and stderr gbytes buffers. This will short circuit any -Eventuallys waiting fo the buffers to Say something. -*/ -func Start(command *exec.Cmd, outWriter io.Writer, errWriter io.Writer) (*Session, error) { - exited := make(chan struct{}) - - session := &Session{ - Command: command, - Out: gbytes.NewBuffer(), - Err: gbytes.NewBuffer(), - Exited: exited, - lock: &sync.Mutex{}, - exitCode: -1, - } - - var commandOut, commandErr io.Writer - - commandOut, commandErr = session.Out, session.Err - - if outWriter != nil && !reflect.ValueOf(outWriter).IsNil() { - commandOut = io.MultiWriter(commandOut, outWriter) - } - - if errWriter != nil && !reflect.ValueOf(errWriter).IsNil() { - commandErr = io.MultiWriter(commandErr, errWriter) - } - - command.Stdout = commandOut - command.Stderr = commandErr - - err := command.Start() - if err == nil { - go session.monitorForExit(exited) - } - - return session, err -} - -/* -Buffer implements the gbytes.BufferProvider interface and returns s.Out -This allows you to make gbytes.Say matcher assertions against stdout without having to reference .Out: - - Eventually(session).Should(gbytes.Say("foo")) -*/ -func (s *Session) Buffer() *gbytes.Buffer { - return s.Out -} - -/* -ExitCode returns the wrapped command's exit code. If the command hasn't exited yet, ExitCode returns -1. - -To assert that the command has exited it is more convenient to use the Exit matcher: - - Eventually(s).Should(gexec.Exit()) - -When the process exits because it has received a particular signal, the exit code will be 128+signal-value -(See http://www.tldp.org/LDP/abs/html/exitcodes.html and http://man7.org/linux/man-pages/man7/signal.7.html) - -*/ -func (s *Session) ExitCode() int { - s.lock.Lock() - defer s.lock.Unlock() - return s.exitCode -} - -/* -Wait waits until the wrapped command exits. It can be passed an optional timeout. -If the command does not exit within the timeout, Wait will trigger a test failure. - -Wait returns the session, making it possible to chain: - - session.Wait().Out.Contents() - -will wait for the command to exit then return the entirety of Out's contents. - -Wait uses eventually under the hood and accepts the same timeout/polling intervals that eventually does. -*/ -func (s *Session) Wait(timeout ...interface{}) *Session { - EventuallyWithOffset(1, s, timeout...).Should(Exit()) - return s -} - -/* -Kill sends the running command a SIGKILL signal. It does not wait for the process to exit. - -If the command has already exited, Kill returns silently. - -The session is returned to enable chaining. -*/ -func (s *Session) Kill() *Session { - if s.ExitCode() != -1 { - return s - } - s.Command.Process.Kill() - return s -} - -/* -Interrupt sends the running command a SIGINT signal. It does not wait for the process to exit. - -If the command has already exited, Interrupt returns silently. - -The session is returned to enable chaining. -*/ -func (s *Session) Interrupt() *Session { - return s.Signal(syscall.SIGINT) -} - -/* -Terminate sends the running command a SIGTERM signal. It does not wait for the process to exit. - -If the command has already exited, Terminate returns silently. - -The session is returned to enable chaining. -*/ -func (s *Session) Terminate() *Session { - return s.Signal(syscall.SIGTERM) -} - -/* -Terminate sends the running command the passed in signal. It does not wait for the process to exit. - -If the command has already exited, Signal returns silently. - -The session is returned to enable chaining. -*/ -func (s *Session) Signal(signal os.Signal) *Session { - if s.ExitCode() != -1 { - return s - } - s.Command.Process.Signal(signal) - return s -} - -func (s *Session) monitorForExit(exited chan<- struct{}) { - err := s.Command.Wait() - s.lock.Lock() - s.Out.Close() - s.Err.Close() - status := s.Command.ProcessState.Sys().(syscall.WaitStatus) - if status.Signaled() { - s.exitCode = 128 + int(status.Signal()) - } else { - exitStatus := status.ExitStatus() - if exitStatus == -1 && err != nil { - s.exitCode = INVALID_EXIT_CODE - } - s.exitCode = exitStatus - } - s.lock.Unlock() - - close(exited) -} diff --git a/vendor/github.com/onsi/gomega/ghttp/handlers.go b/vendor/github.com/onsi/gomega/ghttp/handlers.go deleted file mode 100644 index 63ff6919ad3..00000000000 --- a/vendor/github.com/onsi/gomega/ghttp/handlers.go +++ /dev/null @@ -1,313 +0,0 @@ -package ghttp - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "reflect" - - "github.com/golang/protobuf/proto" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/types" -) - -//CombineHandler takes variadic list of handlers and produces one handler -//that calls each handler in order. -func CombineHandlers(handlers ...http.HandlerFunc) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - for _, handler := range handlers { - handler(w, req) - } - } -} - -//VerifyRequest returns a handler that verifies that a request uses the specified method to connect to the specified path -//You may also pass in an optional rawQuery string which is tested against the request's `req.URL.RawQuery` -// -//For path, you may pass in a string, in which case strict equality will be applied -//Alternatively you can pass in a matcher (ContainSubstring("/foo") and MatchRegexp("/foo/[a-f0-9]+") for example) -func VerifyRequest(method string, path interface{}, rawQuery ...string) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - Ω(req.Method).Should(Equal(method), "Method mismatch") - switch p := path.(type) { - case types.GomegaMatcher: - Ω(req.URL.Path).Should(p, "Path mismatch") - default: - Ω(req.URL.Path).Should(Equal(path), "Path mismatch") - } - if len(rawQuery) > 0 { - values, err := url.ParseQuery(rawQuery[0]) - Ω(err).ShouldNot(HaveOccurred(), "Expected RawQuery is malformed") - - Ω(req.URL.Query()).Should(Equal(values), "RawQuery mismatch") - } - } -} - -//VerifyContentType returns a handler that verifies that a request has a Content-Type header set to the -//specified value -func VerifyContentType(contentType string) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - Ω(req.Header.Get("Content-Type")).Should(Equal(contentType)) - } -} - -//VerifyBasicAuth returns a handler that verifies the request contains a BasicAuth Authorization header -//matching the passed in username and password -func VerifyBasicAuth(username string, password string) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - auth := req.Header.Get("Authorization") - Ω(auth).ShouldNot(Equal(""), "Authorization header must be specified") - - decoded, err := base64.StdEncoding.DecodeString(auth[6:]) - Ω(err).ShouldNot(HaveOccurred()) - - Ω(string(decoded)).Should(Equal(fmt.Sprintf("%s:%s", username, password)), "Authorization mismatch") - } -} - -//VerifyHeader returns a handler that verifies the request contains the passed in headers. -//The passed in header keys are first canonicalized via http.CanonicalHeaderKey. -// -//The request must contain *all* the passed in headers, but it is allowed to have additional headers -//beyond the passed in set. -func VerifyHeader(header http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - for key, values := range header { - key = http.CanonicalHeaderKey(key) - Ω(req.Header[key]).Should(Equal(values), "Header mismatch for key: %s", key) - } - } -} - -//VerifyHeaderKV returns a handler that verifies the request contains a header matching the passed in key and values -//(recall that a `http.Header` is a mapping from string (key) to []string (values)) -//It is a convenience wrapper around `VerifyHeader` that allows you to avoid having to create an `http.Header` object. -func VerifyHeaderKV(key string, values ...string) http.HandlerFunc { - return VerifyHeader(http.Header{key: values}) -} - -//VerifyBody returns a handler that verifies that the body of the request matches the passed in byte array. -//It does this using Equal(). -func VerifyBody(expectedBody []byte) http.HandlerFunc { - return CombineHandlers( - func(w http.ResponseWriter, req *http.Request) { - body, err := ioutil.ReadAll(req.Body) - req.Body.Close() - Ω(err).ShouldNot(HaveOccurred()) - Ω(body).Should(Equal(expectedBody), "Body Mismatch") - }, - ) -} - -//VerifyJSON returns a handler that verifies that the body of the request is a valid JSON representation -//matching the passed in JSON string. It does this using Gomega's MatchJSON method -// -//VerifyJSON also verifies that the request's content type is application/json -func VerifyJSON(expectedJSON string) http.HandlerFunc { - return CombineHandlers( - VerifyContentType("application/json"), - func(w http.ResponseWriter, req *http.Request) { - body, err := ioutil.ReadAll(req.Body) - req.Body.Close() - Ω(err).ShouldNot(HaveOccurred()) - Ω(body).Should(MatchJSON(expectedJSON), "JSON Mismatch") - }, - ) -} - -//VerifyJSONRepresenting is similar to VerifyJSON. Instead of taking a JSON string, however, it -//takes an arbitrary JSON-encodable object and verifies that the requests's body is a JSON representation -//that matches the object -func VerifyJSONRepresenting(object interface{}) http.HandlerFunc { - data, err := json.Marshal(object) - Ω(err).ShouldNot(HaveOccurred()) - return CombineHandlers( - VerifyContentType("application/json"), - VerifyJSON(string(data)), - ) -} - -//VerifyForm returns a handler that verifies a request contains the specified form values. -// -//The request must contain *all* of the specified values, but it is allowed to have additional -//form values beyond the passed in set. -func VerifyForm(values url.Values) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - err := r.ParseForm() - Ω(err).ShouldNot(HaveOccurred()) - for key, vals := range values { - Ω(r.Form[key]).Should(Equal(vals), "Form mismatch for key: %s", key) - } - } -} - -//VerifyFormKV returns a handler that verifies a request contains a form key with the specified values. -// -//It is a convenience wrapper around `VerifyForm` that lets you avoid having to create a `url.Values` object. -func VerifyFormKV(key string, values ...string) http.HandlerFunc { - return VerifyForm(url.Values{key: values}) -} - -//VerifyProtoRepresenting returns a handler that verifies that the body of the request is a valid protobuf -//representation of the passed message. -// -//VerifyProtoRepresenting also verifies that the request's content type is application/x-protobuf -func VerifyProtoRepresenting(expected proto.Message) http.HandlerFunc { - return CombineHandlers( - VerifyContentType("application/x-protobuf"), - func(w http.ResponseWriter, req *http.Request) { - body, err := ioutil.ReadAll(req.Body) - Ω(err).ShouldNot(HaveOccurred()) - req.Body.Close() - - expectedType := reflect.TypeOf(expected) - actualValuePtr := reflect.New(expectedType.Elem()) - - actual, ok := actualValuePtr.Interface().(proto.Message) - Ω(ok).Should(BeTrue(), "Message value is not a proto.Message") - - err = proto.Unmarshal(body, actual) - Ω(err).ShouldNot(HaveOccurred(), "Failed to unmarshal protobuf") - - Ω(actual).Should(Equal(expected), "ProtoBuf Mismatch") - }, - ) -} - -func copyHeader(src http.Header, dst http.Header) { - for key, value := range src { - dst[key] = value - } -} - -/* -RespondWith returns a handler that responds to a request with the specified status code and body - -Body may be a string or []byte - -Also, RespondWith can be given an optional http.Header. The headers defined therein will be added to the response headers. -*/ -func RespondWith(statusCode int, body interface{}, optionalHeader ...http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - if len(optionalHeader) == 1 { - copyHeader(optionalHeader[0], w.Header()) - } - w.WriteHeader(statusCode) - switch x := body.(type) { - case string: - w.Write([]byte(x)) - case []byte: - w.Write(x) - default: - Ω(body).Should(BeNil(), "Invalid type for body. Should be string or []byte.") - } - } -} - -/* -RespondWithPtr returns a handler that responds to a request with the specified status code and body - -Unlike RespondWith, you pass RepondWithPtr a pointer to the status code and body allowing different tests -to share the same setup but specify different status codes and bodies. - -Also, RespondWithPtr can be given an optional http.Header. The headers defined therein will be added to the response headers. -Since the http.Header can be mutated after the fact you don't need to pass in a pointer. -*/ -func RespondWithPtr(statusCode *int, body interface{}, optionalHeader ...http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - if len(optionalHeader) == 1 { - copyHeader(optionalHeader[0], w.Header()) - } - w.WriteHeader(*statusCode) - if body != nil { - switch x := (body).(type) { - case *string: - w.Write([]byte(*x)) - case *[]byte: - w.Write(*x) - default: - Ω(body).Should(BeNil(), "Invalid type for body. Should be string or []byte.") - } - } - } -} - -/* -RespondWithJSONEncoded returns a handler that responds to a request with the specified status code and a body -containing the JSON-encoding of the passed in object - -Also, RespondWithJSONEncoded can be given an optional http.Header. The headers defined therein will be added to the response headers. -*/ -func RespondWithJSONEncoded(statusCode int, object interface{}, optionalHeader ...http.Header) http.HandlerFunc { - data, err := json.Marshal(object) - Ω(err).ShouldNot(HaveOccurred()) - - var headers http.Header - if len(optionalHeader) == 1 { - headers = optionalHeader[0] - } else { - headers = make(http.Header) - } - if _, found := headers["Content-Type"]; !found { - headers["Content-Type"] = []string{"application/json"} - } - return RespondWith(statusCode, string(data), headers) -} - -/* -RespondWithJSONEncodedPtr behaves like RespondWithJSONEncoded but takes a pointer -to a status code and object. - -This allows different tests to share the same setup but specify different status codes and JSON-encoded -objects. - -Also, RespondWithJSONEncodedPtr can be given an optional http.Header. The headers defined therein will be added to the response headers. -Since the http.Header can be mutated after the fact you don't need to pass in a pointer. -*/ -func RespondWithJSONEncodedPtr(statusCode *int, object interface{}, optionalHeader ...http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - data, err := json.Marshal(object) - Ω(err).ShouldNot(HaveOccurred()) - var headers http.Header - if len(optionalHeader) == 1 { - headers = optionalHeader[0] - } else { - headers = make(http.Header) - } - if _, found := headers["Content-Type"]; !found { - headers["Content-Type"] = []string{"application/json"} - } - copyHeader(headers, w.Header()) - w.WriteHeader(*statusCode) - w.Write(data) - } -} - -//RespondWithProto returns a handler that responds to a request with the specified status code and a body -//containing the protobuf serialization of the provided message. -// -//Also, RespondWithProto can be given an optional http.Header. The headers defined therein will be added to the response headers. -func RespondWithProto(statusCode int, message proto.Message, optionalHeader ...http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - data, err := proto.Marshal(message) - Ω(err).ShouldNot(HaveOccurred()) - - var headers http.Header - if len(optionalHeader) == 1 { - headers = optionalHeader[0] - } else { - headers = make(http.Header) - } - if _, found := headers["Content-Type"]; !found { - headers["Content-Type"] = []string{"application/x-protobuf"} - } - copyHeader(headers, w.Header()) - - w.WriteHeader(statusCode) - w.Write(data) - } -} diff --git a/vendor/github.com/onsi/gomega/ghttp/protobuf/protobuf.go b/vendor/github.com/onsi/gomega/ghttp/protobuf/protobuf.go deleted file mode 100644 index b2972bc9fb0..00000000000 --- a/vendor/github.com/onsi/gomega/ghttp/protobuf/protobuf.go +++ /dev/null @@ -1,3 +0,0 @@ -package protobuf - -//go:generate protoc --go_out=. simple_message.proto diff --git a/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.pb.go b/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.pb.go deleted file mode 100644 index c55a48448f2..00000000000 --- a/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.pb.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by protoc-gen-go. -// source: simple_message.proto -// DO NOT EDIT! - -/* -Package protobuf is a generated protocol buffer package. - -It is generated from these files: - simple_message.proto - -It has these top-level messages: - SimpleMessage -*/ -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type SimpleMessage struct { - Description *string `protobuf:"bytes,1,req,name=description" json:"description,omitempty"` - Id *int32 `protobuf:"varint,2,req,name=id" json:"id,omitempty"` - Metadata *string `protobuf:"bytes,3,opt,name=metadata" json:"metadata,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SimpleMessage) Reset() { *m = SimpleMessage{} } -func (m *SimpleMessage) String() string { return proto.CompactTextString(m) } -func (*SimpleMessage) ProtoMessage() {} - -func (m *SimpleMessage) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *SimpleMessage) GetId() int32 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *SimpleMessage) GetMetadata() string { - if m != nil && m.Metadata != nil { - return *m.Metadata - } - return "" -} diff --git a/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.proto b/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.proto deleted file mode 100644 index 35b7145c247..00000000000 --- a/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto2"; - -package protobuf; - -message SimpleMessage { - required string description = 1; - required int32 id = 2; - optional string metadata = 3; -} diff --git a/vendor/github.com/onsi/gomega/ghttp/test_server.go b/vendor/github.com/onsi/gomega/ghttp/test_server.go deleted file mode 100644 index f5f537eb5e9..00000000000 --- a/vendor/github.com/onsi/gomega/ghttp/test_server.go +++ /dev/null @@ -1,379 +0,0 @@ -/* -Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports -registering multiple handlers. Incoming requests are not routed between the different handlers -- rather it is merely the order of the handlers that matters. The first request is handled by the first -registered handler, the second request by the second handler, etc. - -The intent here is to have each handler *verify* that the incoming request is valid. To accomplish, ghttp -also provides a collection of bite-size handlers that each perform one aspect of request verification. These can -be composed together and registered with a ghttp server. The result is an expressive language for describing -the requests generated by the client under test. - -Here's a simple example, note that the server handler is only defined in one BeforeEach and then modified, as required, by the nested BeforeEaches. -A more comprehensive example is available at https://onsi.github.io/gomega/#_testing_http_clients - - var _ = Describe("A Sprockets Client", func() { - var server *ghttp.Server - var client *SprocketClient - BeforeEach(func() { - server = ghttp.NewServer() - client = NewSprocketClient(server.URL(), "skywalker", "tk427") - }) - - AfterEach(func() { - server.Close() - }) - - Describe("fetching sprockets", func() { - var statusCode int - var sprockets []Sprocket - BeforeEach(func() { - statusCode = http.StatusOK - sprockets = []Sprocket{} - server.AppendHandlers(ghttp.CombineHandlers( - ghttp.VerifyRequest("GET", "/sprockets"), - ghttp.VerifyBasicAuth("skywalker", "tk427"), - ghttp.RespondWithJSONEncodedPtr(&statusCode, &sprockets), - )) - }) - - Context("when requesting all sprockets", func() { - Context("when the response is succesful", func() { - BeforeEach(func() { - sprockets = []Sprocket{ - NewSprocket("Alfalfa"), - NewSprocket("Banana"), - } - }) - - It("should return the returned sprockets", func() { - Ω(client.Sprockets()).Should(Equal(sprockets)) - }) - }) - - Context("when the response is missing", func() { - BeforeEach(func() { - statusCode = http.StatusNotFound - }) - - It("should return an empty list of sprockets", func() { - Ω(client.Sprockets()).Should(BeEmpty()) - }) - }) - - Context("when the response fails to authenticate", func() { - BeforeEach(func() { - statusCode = http.StatusUnauthorized - }) - - It("should return an AuthenticationError error", func() { - sprockets, err := client.Sprockets() - Ω(sprockets).Should(BeEmpty()) - Ω(err).Should(MatchError(AuthenticationError)) - }) - }) - - Context("when the response is a server failure", func() { - BeforeEach(func() { - statusCode = http.StatusInternalServerError - }) - - It("should return an InternalError error", func() { - sprockets, err := client.Sprockets() - Ω(sprockets).Should(BeEmpty()) - Ω(err).Should(MatchError(InternalError)) - }) - }) - }) - - Context("when requesting some sprockets", func() { - BeforeEach(func() { - sprockets = []Sprocket{ - NewSprocket("Alfalfa"), - NewSprocket("Banana"), - } - - server.WrapHandler(0, ghttp.VerifyRequest("GET", "/sprockets", "filter=FOOD")) - }) - - It("should make the request with a filter", func() { - Ω(client.Sprockets("food")).Should(Equal(sprockets)) - }) - }) - }) - }) -*/ -package ghttp - -import ( - "fmt" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "reflect" - "regexp" - "strings" - "sync" - - . "github.com/onsi/gomega" -) - -func new() *Server { - return &Server{ - AllowUnhandledRequests: false, - UnhandledRequestStatusCode: http.StatusInternalServerError, - writeLock: &sync.Mutex{}, - } -} - -type routedHandler struct { - method string - pathRegexp *regexp.Regexp - path string - handler http.HandlerFunc -} - -// NewServer returns a new `*ghttp.Server` that wraps an `httptest` server. The server is started automatically. -func NewServer() *Server { - s := new() - s.HTTPTestServer = httptest.NewServer(s) - return s -} - -// NewUnstartedServer return a new, unstarted, `*ghttp.Server`. Useful for specifying a custom listener on `server.HTTPTestServer`. -func NewUnstartedServer() *Server { - s := new() - s.HTTPTestServer = httptest.NewUnstartedServer(s) - return s -} - -// NewTLSServer returns a new `*ghttp.Server` that wraps an `httptest` TLS server. The server is started automatically. -func NewTLSServer() *Server { - s := new() - s.HTTPTestServer = httptest.NewTLSServer(s) - return s -} - -type Server struct { - //The underlying httptest server - HTTPTestServer *httptest.Server - - //Defaults to false. If set to true, the Server will allow more requests than there are registered handlers. - AllowUnhandledRequests bool - - //The status code returned when receiving an unhandled request. - //Defaults to http.StatusInternalServerError. - //Only applies if AllowUnhandledRequests is true - UnhandledRequestStatusCode int - - //If provided, ghttp will log about each request received to the provided io.Writer - //Defaults to nil - //If you're using Ginkgo, set this to GinkgoWriter to get improved output during failures - Writer io.Writer - - receivedRequests []*http.Request - requestHandlers []http.HandlerFunc - routedHandlers []routedHandler - - writeLock *sync.Mutex - calls int -} - -//Start() starts an unstarted ghttp server. It is a catastrophic error to call Start more than once (thanks, httptest). -func (s *Server) Start() { - s.HTTPTestServer.Start() -} - -//URL() returns a url that will hit the server -func (s *Server) URL() string { - return s.HTTPTestServer.URL -} - -//Addr() returns the address on which the server is listening. -func (s *Server) Addr() string { - return s.HTTPTestServer.Listener.Addr().String() -} - -//Close() should be called at the end of each test. It spins down and cleans up the test server. -func (s *Server) Close() { - s.writeLock.Lock() - defer s.writeLock.Unlock() - - server := s.HTTPTestServer - s.HTTPTestServer = nil - server.Close() -} - -//ServeHTTP() makes Server an http.Handler -//When the server receives a request it handles the request in the following order: -// -//1. If the request matches a handler registered with RouteToHandler, that handler is called. -//2. Otherwise, if there are handlers registered via AppendHandlers, those handlers are called in order. -//3. If all registered handlers have been called then: -// a) If AllowUnhandledRequests is true, the request will be handled with response code of UnhandledRequestStatusCode -// b) If AllowUnhandledRequests is false, the request will not be handled and the current test will be marked as failed. -func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) { - s.writeLock.Lock() - defer func() { - e := recover() - if e != nil { - w.WriteHeader(http.StatusInternalServerError) - } - - //If the handler panics GHTTP will silently succeed. This is bad™. - //To catch this case we need to fail the test if the handler has panicked. - //However, if the handler is panicking because Ginkgo's causing it to panic (i.e. an asswertion failed) - //then we shouldn't double-report the error as this will confuse people. - - //So: step 1, if this is a Ginkgo panic - do nothing, Ginkgo's aware of the failure - eAsString, ok := e.(string) - if ok && strings.Contains(eAsString, "defer GinkgoRecover()") { - return - } - - //If we're here, we have to do step 2: assert that the error is nil. This assertion will - //allow us to fail the test suite (note: we can't call Fail since Gomega is not allowed to import Ginkgo). - //Since a failed assertion throws a panic, and we are likely in a goroutine, we need to defer within our defer! - defer func() { - recover() - }() - Ω(e).Should(BeNil(), "Handler Panicked") - }() - - if s.Writer != nil { - s.Writer.Write([]byte(fmt.Sprintf("GHTTP Received Request: %s - %s\n", req.Method, req.URL))) - } - - s.receivedRequests = append(s.receivedRequests, req) - if routedHandler, ok := s.handlerForRoute(req.Method, req.URL.Path); ok { - s.writeLock.Unlock() - routedHandler(w, req) - } else if s.calls < len(s.requestHandlers) { - h := s.requestHandlers[s.calls] - s.calls++ - s.writeLock.Unlock() - h(w, req) - } else { - s.writeLock.Unlock() - if s.AllowUnhandledRequests { - ioutil.ReadAll(req.Body) - req.Body.Close() - w.WriteHeader(s.UnhandledRequestStatusCode) - } else { - Ω(req).Should(BeNil(), "Received Unhandled Request") - } - } -} - -//ReceivedRequests is an array containing all requests received by the server (both handled and unhandled requests) -func (s *Server) ReceivedRequests() []*http.Request { - s.writeLock.Lock() - defer s.writeLock.Unlock() - - return s.receivedRequests -} - -//RouteToHandler can be used to register handlers that will always handle requests that match -//the passed in method and path. -// -//The path may be either a string object or a *regexp.Regexp. -func (s *Server) RouteToHandler(method string, path interface{}, handler http.HandlerFunc) { - s.writeLock.Lock() - defer s.writeLock.Unlock() - - rh := routedHandler{ - method: method, - handler: handler, - } - - switch p := path.(type) { - case *regexp.Regexp: - rh.pathRegexp = p - case string: - rh.path = p - default: - panic("path must be a string or a regular expression") - } - - for i, existingRH := range s.routedHandlers { - if existingRH.method == method && - reflect.DeepEqual(existingRH.pathRegexp, rh.pathRegexp) && - existingRH.path == rh.path { - s.routedHandlers[i] = rh - return - } - } - s.routedHandlers = append(s.routedHandlers, rh) -} - -func (s *Server) handlerForRoute(method string, path string) (http.HandlerFunc, bool) { - for _, rh := range s.routedHandlers { - if rh.method == method { - if rh.pathRegexp != nil { - if rh.pathRegexp.Match([]byte(path)) { - return rh.handler, true - } - } else if rh.path == path { - return rh.handler, true - } - } - } - - return nil, false -} - -//AppendHandlers will appends http.HandlerFuncs to the server's list of registered handlers. The first incoming request is handled by the first handler, the second by the second, etc... -func (s *Server) AppendHandlers(handlers ...http.HandlerFunc) { - s.writeLock.Lock() - defer s.writeLock.Unlock() - - s.requestHandlers = append(s.requestHandlers, handlers...) -} - -//SetHandler overrides the registered handler at the passed in index with the passed in handler -//This is useful, for example, when a server has been set up in a shared context, but must be tweaked -//for a particular test. -func (s *Server) SetHandler(index int, handler http.HandlerFunc) { - s.writeLock.Lock() - defer s.writeLock.Unlock() - - s.requestHandlers[index] = handler -} - -//GetHandler returns the handler registered at the passed in index. -func (s *Server) GetHandler(index int) http.HandlerFunc { - s.writeLock.Lock() - defer s.writeLock.Unlock() - - return s.requestHandlers[index] -} - -func (s *Server) Reset() { - s.writeLock.Lock() - defer s.writeLock.Unlock() - - s.HTTPTestServer.CloseClientConnections() - s.calls = 0 - s.receivedRequests = nil - s.requestHandlers = nil - s.routedHandlers = nil -} - -//WrapHandler combines the passed in handler with the handler registered at the passed in index. -//This is useful, for example, when a server has been set up in a shared context but must be tweaked -//for a particular test. -// -//If the currently registered handler is A, and the new passed in handler is B then -//WrapHandler will generate a new handler that first calls A, then calls B, and assign it to index -func (s *Server) WrapHandler(index int, handler http.HandlerFunc) { - existingHandler := s.GetHandler(index) - s.SetHandler(index, CombineHandlers(existingHandler, handler)) -} - -func (s *Server) CloseClientConnections() { - s.writeLock.Lock() - defer s.writeLock.Unlock() - - s.HTTPTestServer.CloseClientConnections() -} diff --git a/vendor/github.com/onsi/gomega/internal/fakematcher/fake_matcher.go b/vendor/github.com/onsi/gomega/internal/fakematcher/fake_matcher.go deleted file mode 100644 index 6e351a7de57..00000000000 --- a/vendor/github.com/onsi/gomega/internal/fakematcher/fake_matcher.go +++ /dev/null @@ -1,23 +0,0 @@ -package fakematcher - -import "fmt" - -type FakeMatcher struct { - ReceivedActual interface{} - MatchesToReturn bool - ErrToReturn error -} - -func (matcher *FakeMatcher) Match(actual interface{}) (bool, error) { - matcher.ReceivedActual = actual - - return matcher.MatchesToReturn, matcher.ErrToReturn -} - -func (matcher *FakeMatcher) FailureMessage(actual interface{}) string { - return fmt.Sprintf("positive: %v", actual) -} - -func (matcher *FakeMatcher) NegatedFailureMessage(actual interface{}) string { - return fmt.Sprintf("negative: %v", actual) -} diff --git a/vendor/github.com/onsi/gomega/matchers/support/goraph/MIT.LICENSE b/vendor/github.com/onsi/gomega/matchers/support/goraph/MIT.LICENSE deleted file mode 100644 index 8edd8175abe..00000000000 --- a/vendor/github.com/onsi/gomega/matchers/support/goraph/MIT.LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2014 Amit Kumar Gupta - -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/opencontainers/runc/Godeps/_workspace/src/github.com/Sirupsen/logrus/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/Sirupsen/logrus/LICENSE deleted file mode 100644 index f090cb42f37..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/Sirupsen/logrus/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Simon Eskildsen - -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/opencontainers/runc/Godeps/_workspace/src/github.com/codegangsta/cli/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/codegangsta/cli/LICENSE deleted file mode 100644 index 5515ccfb716..00000000000 --- a/vendor/github.com/opencontainers/runc/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/opencontainers/runc/Godeps/_workspace/src/github.com/coreos/go-systemd/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/coreos/go-systemd/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/coreos/go-systemd/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/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/LICENSE deleted file mode 100644 index c7a3f0cfd45..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://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 2013-2015 Docker, Inc. - - 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 - - https://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/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/NOTICE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/NOTICE deleted file mode 100644 index 6e6f469ab9b..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/NOTICE +++ /dev/null @@ -1,19 +0,0 @@ -Docker -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (https://www.docker.com). - -This product contains software (https://github.com/kr/pty) developed -by Keith Rarick, licensed under the MIT License. - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see https://www.bis.doc.gov - -See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/contrib/syntax/vim/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/contrib/syntax/vim/LICENSE deleted file mode 100644 index e67cdabd22e..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/contrib/syntax/vim/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Honza Pokorny -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/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/docs/project/images/red_notice.png b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/docs/project/images/red_notice.png deleted file mode 100644 index 8839723a376..00000000000 Binary files a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/docs/project/images/red_notice.png and /dev/null differ diff --git a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/LICENSE deleted file mode 100644 index ac74d8f0496..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014-2015 The Docker & 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/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.APACHE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.APACHE deleted file mode 100644 index 9e4bd4dbee9..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.APACHE +++ /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 2014-2015 Docker, Inc. - - 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/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD deleted file mode 100644 index ac74d8f0496..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014-2015 The Docker & 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/opencontainers/runc/Godeps/_workspace/src/github.com/docker/go-units/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/go-units/LICENSE deleted file mode 100644 index b55b37bc316..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/docker/go-units/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://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 Docker, Inc. - - 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 - - https://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/opencontainers/runc/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE deleted file mode 100644 index 670d88fcaaf..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/godbus/dbus/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2013, Georg Reinke (), Google -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/opencontainers/runc/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE deleted file mode 100644 index 1b1b1921efa..00000000000 --- a/vendor/github.com/opencontainers/runc/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/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/specs/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/specs/LICENSE deleted file mode 100644 index bdc403653e0..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/opencontainers/specs/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 The Linux Foundation. - - 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/opencontainers/runc/Godeps/_workspace/src/github.com/seccomp/libseccomp-golang/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/seccomp/libseccomp-golang/LICENSE deleted file mode 100644 index 81cf60de29e..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/seccomp/libseccomp-golang/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2015 Matthew Heon -Copyright (c) 2015 Paul Moore -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. - -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/opencontainers/runc/Godeps/_workspace/src/github.com/syndtr/gocapability/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/syndtr/gocapability/LICENSE deleted file mode 100644 index 80dd96de77f..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/syndtr/gocapability/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2013 Suryandaru Triandana -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. - -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/opencontainers/runc/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE b/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE deleted file mode 100644 index 9f64db8582c..00000000000 --- a/vendor/github.com/opencontainers/runc/Godeps/_workspace/src/github.com/vishvananda/netlink/LICENSE +++ /dev/null @@ -1,192 +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 2014 Vishvananda Ishaya. - Copyright 2014 Docker, Inc. - - 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/opencontainers/runc/libcontainer/devices/devices_unix.go b/vendor/github.com/opencontainers/runc/libcontainer/devices/devices_unix.go deleted file mode 100644 index c02b73e3e6a..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/devices/devices_unix.go +++ /dev/null @@ -1,102 +0,0 @@ -// +build linux freebsd - -package devices - -import ( - "errors" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "syscall" - - "github.com/opencontainers/runc/libcontainer/configs" -) - -var ( - ErrNotADevice = errors.New("not a device node") -) - -// Testing dependencies -var ( - osLstat = os.Lstat - ioutilReadDir = ioutil.ReadDir -) - -// Given the path to a device and it's cgroup_permissions(which cannot be easily queried) look up the information about a linux device and return that information as a Device struct. -func DeviceFromPath(path, permissions string) (*configs.Device, error) { - fileInfo, err := osLstat(path) - if err != nil { - return nil, err - } - var ( - devType rune - mode = fileInfo.Mode() - fileModePermissionBits = os.FileMode.Perm(mode) - ) - switch { - case mode&os.ModeDevice == 0: - return nil, ErrNotADevice - case mode&os.ModeCharDevice != 0: - fileModePermissionBits |= syscall.S_IFCHR - devType = 'c' - default: - fileModePermissionBits |= syscall.S_IFBLK - devType = 'b' - } - stat_t, ok := fileInfo.Sys().(*syscall.Stat_t) - if !ok { - return nil, fmt.Errorf("cannot determine the device number for device %s", path) - } - devNumber := int(stat_t.Rdev) - return &configs.Device{ - Type: devType, - Path: path, - Major: Major(devNumber), - Minor: Minor(devNumber), - Permissions: permissions, - FileMode: fileModePermissionBits, - Uid: stat_t.Uid, - Gid: stat_t.Gid, - }, nil -} - -func HostDevices() ([]*configs.Device, error) { - return getDevices("/dev") -} - -func getDevices(path string) ([]*configs.Device, error) { - files, err := ioutilReadDir(path) - if err != nil { - return nil, err - } - out := []*configs.Device{} - for _, f := range files { - switch { - case f.IsDir(): - switch f.Name() { - case "pts", "shm", "fd", "mqueue": - continue - default: - sub, err := getDevices(filepath.Join(path, f.Name())) - if err != nil { - return nil, err - } - - out = append(out, sub...) - continue - } - case f.Name() == "console": - continue - } - device, err := DeviceFromPath(filepath.Join(path, f.Name()), "rwm") - if err != nil { - if err == ErrNotADevice { - continue - } - return nil, err - } - out = append(out, device) - } - return out, nil -} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/devices/devices_unsupported.go b/vendor/github.com/opencontainers/runc/libcontainer/devices/devices_unsupported.go deleted file mode 100644 index 1e84033daff..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/devices/devices_unsupported.go +++ /dev/null @@ -1,3 +0,0 @@ -// +build windows - -package devices diff --git a/vendor/github.com/opencontainers/runc/libcontainer/devices/number.go b/vendor/github.com/opencontainers/runc/libcontainer/devices/number.go deleted file mode 100644 index 885b6e5dd93..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/devices/number.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build linux freebsd - -package devices - -/* - -This code provides support for manipulating linux device numbers. It should be replaced by normal syscall functions once http://code.google.com/p/go/issues/detail?id=8106 is solved. - -You can read what they are here: - - - http://www.makelinux.net/ldd3/chp-3-sect-2 - - http://www.linux-tutorial.info/modules.php?name=MContent&pageid=94 - -Note! These are NOT the same as the MAJOR(dev_t device);, MINOR(dev_t device); and MKDEV(int major, int minor); functions as defined in as the representation of device numbers used by go is different than the one used internally to the kernel! - https://github.com/torvalds/linux/blob/master/include/linux/kdev_t.h#L9 - -*/ - -func Major(devNumber int) int64 { - return int64((devNumber >> 8) & 0xfff) -} - -func Minor(devNumber int) int64 { - return int64((devNumber & 0xff) | ((devNumber >> 12) & 0xfff00)) -} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/integration/doc.go b/vendor/github.com/opencontainers/runc/libcontainer/integration/doc.go deleted file mode 100644 index 87545bc99c3..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/integration/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// integration is used for integration testing of libcontainer -package integration diff --git a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/README.md b/vendor/github.com/opencontainers/runc/libcontainer/nsenter/README.md deleted file mode 100644 index d1a60ef9850..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/README.md +++ /dev/null @@ -1,25 +0,0 @@ -## nsenter - -The `nsenter` package registers a special init constructor that is called before -the Go runtime has a chance to boot. This provides us the ability to `setns` on -existing namespaces and avoid the issues that the Go runtime has with multiple -threads. This constructor will be called if this package is registered, -imported, in your go application. - -The `nsenter` package will `import "C"` and it uses [cgo](https://golang.org/cmd/cgo/) -package. In cgo, if the import of "C" is immediately preceded by a comment, that comment, -called the preamble, is used as a header when compiling the C parts of the package. -So every time we import package `nsenter`, the C code function `nsexec()` would be -called. And package `nsenter` is now only imported in Docker execdriver, so every time -before we call `execdriver.Exec()`, that C code would run. - -`nsexec()` will first check the environment variable `_LIBCONTAINER_INITPID` -which will give the process of the container that should be joined. Namespaces fd will -be found from `/proc/[pid]/ns` and set by `setns` syscall. - -And then get the pipe number from `_LIBCONTAINER_INITPIPE`, error message could -be transfered through it. If tty is added, `_LIBCONTAINER_CONSOLE_PATH` will -have value and start a console for output. - -Finally, `nsexec()` will clone a child process , exit the parent process and let -the Go runtime take over. diff --git a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter.go b/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter.go deleted file mode 100644 index 07f4d63e433..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build linux,!gccgo - -package nsenter - -/* -#cgo CFLAGS: -Wall -extern void nsexec(); -void __attribute__((constructor)) init(void) { - nsexec(); -} -*/ -import "C" diff --git a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_gccgo.go b/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_gccgo.go deleted file mode 100644 index 63c7a3ec221..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_gccgo.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build linux,gccgo - -package nsenter - -/* -#cgo CFLAGS: -Wall -extern void nsexec(); -void __attribute__((constructor)) init(void) { - nsexec(); -} -*/ -import "C" - -// AlwaysFalse is here to stay false -// (and be exported so the compiler doesn't optimize out its reference) -var AlwaysFalse bool - -func init() { - if AlwaysFalse { - // by referencing this C init() in a noop test, it will ensure the compiler - // links in the C function. - // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65134 - C.init() - } -} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_unsupported.go b/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_unsupported.go deleted file mode 100644 index ac701ca393b..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_unsupported.go +++ /dev/null @@ -1,5 +0,0 @@ -// +build !linux !cgo - -package nsenter - -import "C" diff --git a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsexec.c b/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsexec.c deleted file mode 100644 index 27e6e53d4da..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsexec.c +++ /dev/null @@ -1,260 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* All arguments should be above stack, because it grows down */ -struct clone_arg { - /* - * Reserve some space for clone() to locate arguments - * and retcode in this place - */ - char stack[4096] __attribute__ ((aligned(16))); - char stack_ptr[0]; - jmp_buf *env; -}; - -#define pr_perror(fmt, ...) fprintf(stderr, "nsenter: " fmt ": %m\n", ##__VA_ARGS__) - -static int child_func(void *_arg) -{ - struct clone_arg *arg = (struct clone_arg *)_arg; - longjmp(*arg->env, 1); -} - -// Use raw setns syscall for versions of glibc that don't include it (namely glibc-2.12) -#if __GLIBC__ == 2 && __GLIBC_MINOR__ < 14 -#define _GNU_SOURCE -#include "syscall.h" -#if defined(__NR_setns) && !defined(SYS_setns) -#define SYS_setns __NR_setns -#endif -#ifdef SYS_setns -int setns(int fd, int nstype) -{ - return syscall(SYS_setns, fd, nstype); -} -#endif -#endif - -static int clone_parent(jmp_buf * env) __attribute__ ((noinline)); -static int clone_parent(jmp_buf * env) -{ - struct clone_arg ca; - int child; - - ca.env = env; - child = clone(child_func, ca.stack_ptr, CLONE_PARENT | SIGCHLD, &ca); - - return child; -} - -static uint32_t readint32(char *buf) -{ - return *(uint32_t *) buf; -} - -// list of known message types we want to send to bootstrap program -// These are defined in libcontainer/message_linux.go -#define INIT_MSG 62000 -#define PID_ATTR 27281 -#define CONSOLE_PATH_ATTR 27282 - -void nsexec() -{ - char *namespaces[] = { "ipc", "uts", "net", "pid", "mnt", "user" }; - const int num = sizeof(namespaces) / sizeof(char *); - jmp_buf env; - char buf[PATH_MAX], *val; - int i, tfd, self_tfd, child, n, len, pipenum, consolefd = -1; - pid_t pid = 0; - - // if we dont have INITTYPE or this is the init process, skip the bootstrap process - val = getenv("_LIBCONTAINER_INITTYPE"); - if (val == NULL || strcmp(val, "standard") == 0) { - return; - } - if (strcmp(val, "setns") != 0) { - pr_perror("Invalid inittype %s", val); - exit(1); - } - - val = getenv("_LIBCONTAINER_INITPIPE"); - if (val == NULL) { - pr_perror("Child pipe not found"); - exit(1); - } - pipenum = atoi(val); - snprintf(buf, sizeof(buf), "%d", pipenum); - if (strcmp(val, buf)) { - pr_perror("Unable to parse _LIBCONTAINER_INITPIPE"); - exit(1); - } - - char nlbuf[NLMSG_HDRLEN]; - struct nlmsghdr *nh; - if ((n = read(pipenum, nlbuf, NLMSG_HDRLEN)) != NLMSG_HDRLEN) { - pr_perror("Failed to read netlink header, got %d", n); - exit(1); - } - - nh = (struct nlmsghdr *)nlbuf; - if (nh->nlmsg_type == NLMSG_ERROR) { - pr_perror("Invalid netlink header message"); - exit(1); - } - if (nh->nlmsg_type != INIT_MSG) { - pr_perror("Unexpected netlink message type %d", nh->nlmsg_type); - exit(1); - } - // read the netlink payload - len = NLMSG_PAYLOAD(nh, 0); - char data[len]; - if ((n = read(pipenum, data, len)) != len) { - pr_perror("Failed to read netlink payload, got %d", n); - exit(1); - } - - int start = 0; - struct nlattr *attr; - while (start < len) { - int payload_len; - attr = (struct nlattr *)((void *)data + start); - start += NLA_HDRLEN; - payload_len = attr->nla_len - NLA_HDRLEN; - switch (attr->nla_type) { - case PID_ATTR: - pid = (pid_t) readint32(data + start); - break; - case CONSOLE_PATH_ATTR: - consolefd = open((char *)data + start, O_RDWR); - if (consolefd < 0) { - pr_perror("Failed to open console %s", (char *)data + start); - exit(1); - } - break; - } - start += NLA_ALIGN(payload_len); - } - - // required pid to be passed - if (pid == 0) { - pr_perror("missing pid"); - exit(1); - } - - /* Check that the specified process exists */ - snprintf(buf, PATH_MAX - 1, "/proc/%d/ns", pid); - tfd = open(buf, O_DIRECTORY | O_RDONLY); - if (tfd == -1) { - pr_perror("Failed to open \"%s\"", buf); - exit(1); - } - - self_tfd = open("/proc/self/ns", O_DIRECTORY | O_RDONLY); - if (self_tfd == -1) { - pr_perror("Failed to open /proc/self/ns"); - exit(1); - } - - for (i = 0; i < num; i++) { - struct stat st; - struct stat self_st; - int fd; - - /* Symlinks on all namespaces exist for dead processes, but they can't be opened */ - if (fstatat(tfd, namespaces[i], &st, 0) == -1) { - // Ignore nonexistent namespaces. - if (errno == ENOENT) - continue; - } - - /* Skip namespaces we're already part of */ - if (fstatat(self_tfd, namespaces[i], &self_st, 0) != -1 && st.st_ino == self_st.st_ino) { - continue; - } - - fd = openat(tfd, namespaces[i], O_RDONLY); - if (fd == -1) { - pr_perror("Failed to open ns file %s for ns %s", buf, namespaces[i]); - exit(1); - } - // Set the namespace. - if (setns(fd, 0) == -1) { - pr_perror("Failed to setns for %s", namespaces[i]); - exit(1); - } - close(fd); - } - - close(self_tfd); - close(tfd); - - if (setjmp(env) == 1) { - // Child - - if (setsid() == -1) { - pr_perror("setsid failed"); - exit(1); - } - if (consolefd != -1) { - if (ioctl(consolefd, TIOCSCTTY, 0) == -1) { - pr_perror("ioctl TIOCSCTTY failed"); - exit(1); - } - if (dup3(consolefd, STDIN_FILENO, 0) != STDIN_FILENO) { - pr_perror("Failed to dup 0"); - exit(1); - } - if (dup3(consolefd, STDOUT_FILENO, 0) != STDOUT_FILENO) { - pr_perror("Failed to dup 1"); - exit(1); - } - if (dup3(consolefd, STDERR_FILENO, 0) != STDERR_FILENO) { - pr_perror("Failed to dup 2"); - exit(1); - } - } - // Finish executing, let the Go runtime take over. - return; - } - // Parent - - // We must fork to actually enter the PID namespace, use CLONE_PARENT - // so the child can have the right parent, and we don't need to forward - // the child's exit code or resend its death signal. - child = clone_parent(&env); - if (child < 0) { - pr_perror("Unable to fork"); - exit(1); - } - - len = snprintf(buf, sizeof(buf), "{ \"pid\" : %d }\n", child); - - if (write(pipenum, buf, len) != len) { - pr_perror("Unable to send a child pid"); - kill(child, SIGKILL); - exit(1); - } - - exit(0); -} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/seccomp/fixtures/proc_self_status b/vendor/github.com/opencontainers/runc/libcontainer/seccomp/fixtures/proc_self_status deleted file mode 100644 index 0e0084f6c28..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/seccomp/fixtures/proc_self_status +++ /dev/null @@ -1,47 +0,0 @@ -Name: cat -State: R (running) -Tgid: 19383 -Ngid: 0 -Pid: 19383 -PPid: 19275 -TracerPid: 0 -Uid: 1000 1000 1000 1000 -Gid: 1000 1000 1000 1000 -FDSize: 256 -Groups: 24 25 27 29 30 44 46 102 104 108 111 1000 1001 -NStgid: 19383 -NSpid: 19383 -NSpgid: 19383 -NSsid: 19275 -VmPeak: 5944 kB -VmSize: 5944 kB -VmLck: 0 kB -VmPin: 0 kB -VmHWM: 744 kB -VmRSS: 744 kB -VmData: 324 kB -VmStk: 136 kB -VmExe: 48 kB -VmLib: 1776 kB -VmPTE: 32 kB -VmPMD: 12 kB -VmSwap: 0 kB -Threads: 1 -SigQ: 0/30067 -SigPnd: 0000000000000000 -ShdPnd: 0000000000000000 -SigBlk: 0000000000000000 -SigIgn: 0000000000000080 -SigCgt: 0000000000000000 -CapInh: 0000000000000000 -CapPrm: 0000000000000000 -CapEff: 0000000000000000 -CapBnd: 0000003fffffffff -CapAmb: 0000000000000000 -Seccomp: 0 -Cpus_allowed: f -Cpus_allowed_list: 0-3 -Mems_allowed: 00000000,00000001 -Mems_allowed_list: 0 -voluntary_ctxt_switches: 0 -nonvoluntary_ctxt_switches: 1 diff --git a/vendor/github.com/opencontainers/runc/libcontainer/xattr/errors.go b/vendor/github.com/opencontainers/runc/libcontainer/xattr/errors.go deleted file mode 100644 index 8cd77418ccf..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/xattr/errors.go +++ /dev/null @@ -1,8 +0,0 @@ -package xattr - -import ( - "fmt" - "runtime" -) - -var ErrNotSupportedPlatform = fmt.Errorf("platform and architecture is not supported %s %s", runtime.GOOS, runtime.GOARCH) diff --git a/vendor/github.com/opencontainers/runc/libcontainer/xattr/xattr_linux.go b/vendor/github.com/opencontainers/runc/libcontainer/xattr/xattr_linux.go deleted file mode 100644 index 933a75272e2..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/xattr/xattr_linux.go +++ /dev/null @@ -1,53 +0,0 @@ -// +build linux - -package xattr - -import ( - "syscall" - - "github.com/opencontainers/runc/libcontainer/system" -) - -func XattrEnabled(path string) bool { - if Setxattr(path, "user.test", "") == syscall.ENOTSUP { - return false - } - return true -} - -func stringsfromByte(buf []byte) (result []string) { - offset := 0 - for index, b := range buf { - if b == 0 { - result = append(result, string(buf[offset:index])) - offset = index + 1 - } - } - return -} - -func Listxattr(path string) ([]string, error) { - size, err := system.Llistxattr(path, nil) - if err != nil { - return nil, err - } - buf := make([]byte, size) - read, err := system.Llistxattr(path, buf) - if err != nil { - return nil, err - } - names := stringsfromByte(buf[:read]) - return names, nil -} - -func Getxattr(path, attr string) (string, error) { - value, err := system.Lgetxattr(path, attr) - if err != nil { - return "", err - } - return string(value), nil -} - -func Setxattr(path, xattr, value string) error { - return system.Lsetxattr(path, xattr, []byte(value), 0) -} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/xattr/xattr_unsupported.go b/vendor/github.com/opencontainers/runc/libcontainer/xattr/xattr_unsupported.go deleted file mode 100644 index 821dea3be11..00000000000 --- a/vendor/github.com/opencontainers/runc/libcontainer/xattr/xattr_unsupported.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build !linux - -package xattr - -func Listxattr(path string) ([]string, error) { - return nil, ErrNotSupportedPlatform -} - -func Getxattr(path, attr string) (string, error) { - return "", ErrNotSupportedPlatform -} - -func Setxattr(path, xattr, value string) error { - return ErrNotSupportedPlatform -} diff --git a/vendor/github.com/prometheus/client_model/ruby/LICENSE b/vendor/github.com/prometheus/client_model/ruby/LICENSE deleted file mode 100644 index 11069edd790..00000000000 --- a/vendor/github.com/prometheus/client_model/ruby/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/prometheus/common/expfmt/fuzz/corpus/from_test_parse_0 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_0 deleted file mode 100644 index 139597f9cb0..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_0 +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_1 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_1 deleted file mode 100644 index 2ae8706797b..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_1 +++ /dev/null @@ -1,6 +0,0 @@ - -minimal_metric 1.234 -another_metric -3e3 103948 -# Even that: -no_labels{} 3 -# HELP line for non-existing metric will be ignored. diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_2 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_2 deleted file mode 100644 index 5c351db36d3..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_2 +++ /dev/null @@ -1,12 +0,0 @@ - -# A normal comment. -# -# TYPE name counter -name{labelname="val1",basename="basevalue"} NaN -name {labelname="val2",basename="base\"v\\al\nue"} 0.23 1234567890 -# HELP name two-line\n doc str\\ing - - # HELP name2 doc str"ing 2 - # TYPE name2 gauge -name2{labelname="val2" ,basename = "basevalue2" } +Inf 54321 -name2{ labelname = "val1" , }-Inf diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_3 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_3 deleted file mode 100644 index 0b3c345aa9c..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_3 +++ /dev/null @@ -1,22 +0,0 @@ - -# TYPE my_summary summary -my_summary{n1="val1",quantile="0.5"} 110 -decoy -1 -2 -my_summary{n1="val1",quantile="0.9"} 140 1 -my_summary_count{n1="val1"} 42 -# Latest timestamp wins in case of a summary. -my_summary_sum{n1="val1"} 4711 2 -fake_sum{n1="val1"} 2001 -# TYPE another_summary summary -another_summary_count{n2="val2",n1="val1"} 20 -my_summary_count{n2="val2",n1="val1"} 5 5 -another_summary{n1="val1",n2="val2",quantile=".3"} -1.2 -my_summary_sum{n1="val2"} 08 15 -my_summary{n1="val3", quantile="0.2"} 4711 - my_summary{n1="val1",n2="val2",quantile="-12.34",} NaN -# some -# funny comments -# HELP -# HELP -# HELP my_summary -# HELP my_summary diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_4 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_4 deleted file mode 100644 index bde0a387aa2..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_4 +++ /dev/null @@ -1,10 +0,0 @@ - -# HELP request_duration_microseconds The response latency. -# TYPE request_duration_microseconds histogram -request_duration_microseconds_bucket{le="100"} 123 -request_duration_microseconds_bucket{le="120"} 412 -request_duration_microseconds_bucket{le="144"} 592 -request_duration_microseconds_bucket{le="172.8"} 1524 -request_duration_microseconds_bucket{le="+Inf"} 2693 -request_duration_microseconds_sum 1.7560473e+06 -request_duration_microseconds_count 2693 diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_0 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_0 deleted file mode 100644 index 4c67f9a198a..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_0 +++ /dev/null @@ -1 +0,0 @@ -bla 3.14 \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_1 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_1 deleted file mode 100644 index b853478ee2f..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_1 +++ /dev/null @@ -1 +0,0 @@ -metric{label="\t"} 3.14 \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_10 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_10 deleted file mode 100644 index b5fe5f5a68c..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_10 +++ /dev/null @@ -1 +0,0 @@ -metric{label="bla"} 3.14 2 3 diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_11 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_11 deleted file mode 100644 index 57c7fbc0bc4..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_11 +++ /dev/null @@ -1 +0,0 @@ -metric{label="bla"} blubb diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_12 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_12 deleted file mode 100644 index 0a9df79a1e6..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_12 +++ /dev/null @@ -1,3 +0,0 @@ - -# HELP metric one -# HELP metric two diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_13 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_13 deleted file mode 100644 index 5bc7427813e..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_13 +++ /dev/null @@ -1,3 +0,0 @@ - -# TYPE metric counter -# TYPE metric untyped diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_14 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_14 deleted file mode 100644 index a9a24265b29..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_14 +++ /dev/null @@ -1,3 +0,0 @@ - -metric 4.12 -# TYPE metric counter diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_15 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_15 deleted file mode 100644 index 7e95ca8f4c1..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_15 +++ /dev/null @@ -1,2 +0,0 @@ - -# TYPE metric bla diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_16 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_16 deleted file mode 100644 index 7825f888723..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_16 +++ /dev/null @@ -1,2 +0,0 @@ - -# TYPE met-ric diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_17 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_17 deleted file mode 100644 index 8f35cae0cf0..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_17 +++ /dev/null @@ -1 +0,0 @@ -@invalidmetric{label="bla"} 3.14 2 \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_18 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_18 deleted file mode 100644 index 7ca2cc268b0..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_18 +++ /dev/null @@ -1 +0,0 @@ -{label="bla"} 3.14 2 \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_19 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_19 deleted file mode 100644 index 7a6ccc0dd47..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_19 +++ /dev/null @@ -1,3 +0,0 @@ - -# TYPE metric histogram -metric_bucket{le="bla"} 3.14 diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_2 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_2 deleted file mode 100644 index 726d0017cb0..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_2 +++ /dev/null @@ -1,3 +0,0 @@ - -metric{label="new -line"} 3.14 diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_3 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_3 deleted file mode 100644 index 6aa9e308140..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_3 +++ /dev/null @@ -1 +0,0 @@ -metric{@="bla"} 3.14 \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_4 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_4 deleted file mode 100644 index d112cb90252..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_4 +++ /dev/null @@ -1 +0,0 @@ -metric{__name__="bla"} 3.14 \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_5 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_5 deleted file mode 100644 index b34554a8d6b..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_5 +++ /dev/null @@ -1 +0,0 @@ -metric{label+="bla"} 3.14 \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_6 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_6 deleted file mode 100644 index c4d7df3d111..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_6 +++ /dev/null @@ -1 +0,0 @@ -metric{label=bla} 3.14 \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_7 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_7 deleted file mode 100644 index 97eafc4a653..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_7 +++ /dev/null @@ -1,3 +0,0 @@ - -# TYPE metric summary -metric{quantile="bla"} 3.14 diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_8 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_8 deleted file mode 100644 index fc706496b7c..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_8 +++ /dev/null @@ -1 +0,0 @@ -metric{label="bla"+} 3.14 \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_9 b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_9 deleted file mode 100644 index 57b4879c059..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/from_test_parse_error_9 +++ /dev/null @@ -1 +0,0 @@ -metric{label="bla"} 3.14 2.72 diff --git a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/minimal b/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/minimal deleted file mode 100644 index be1e6a369dd..00000000000 --- a/vendor/github.com/prometheus/common/expfmt/fuzz/corpus/minimal +++ /dev/null @@ -1 +0,0 @@ -m{} 0 diff --git a/vendor/github.com/prometheus/procfs/fixtures/26231/cmdline b/vendor/github.com/prometheus/procfs/fixtures/26231/cmdline deleted file mode 100644 index d2d8ef88764..00000000000 Binary files a/vendor/github.com/prometheus/procfs/fixtures/26231/cmdline and /dev/null differ diff --git a/vendor/github.com/prometheus/procfs/fixtures/26231/fd/0 b/vendor/github.com/prometheus/procfs/fixtures/26231/fd/0 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/vendor/github.com/prometheus/procfs/fixtures/26231/fd/1 b/vendor/github.com/prometheus/procfs/fixtures/26231/fd/1 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/vendor/github.com/prometheus/procfs/fixtures/26231/fd/2 b/vendor/github.com/prometheus/procfs/fixtures/26231/fd/2 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/vendor/github.com/prometheus/procfs/fixtures/26231/fd/3 b/vendor/github.com/prometheus/procfs/fixtures/26231/fd/3 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/vendor/github.com/prometheus/procfs/fixtures/26231/fd/4 b/vendor/github.com/prometheus/procfs/fixtures/26231/fd/4 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/vendor/github.com/prometheus/procfs/fixtures/26231/limits b/vendor/github.com/prometheus/procfs/fixtures/26231/limits deleted file mode 100644 index 23c6b6898f1..00000000000 --- a/vendor/github.com/prometheus/procfs/fixtures/26231/limits +++ /dev/null @@ -1,17 +0,0 @@ -Limit Soft Limit Hard Limit Units -Max cpu time unlimited unlimited seconds -Max file size unlimited unlimited bytes -Max data size unlimited unlimited bytes -Max stack size 8388608 unlimited bytes -Max core file size 0 unlimited bytes -Max resident set unlimited unlimited bytes -Max processes 62898 62898 processes -Max open files 2048 4096 files -Max locked memory 65536 65536 bytes -Max address space unlimited unlimited bytes -Max file locks unlimited unlimited locks -Max pending signals 62898 62898 signals -Max msgqueue size 819200 819200 bytes -Max nice priority 0 0 -Max realtime priority 0 0 -Max realtime timeout unlimited unlimited us diff --git a/vendor/github.com/prometheus/procfs/fixtures/26231/stat b/vendor/github.com/prometheus/procfs/fixtures/26231/stat deleted file mode 100644 index 438aaa9dce0..00000000000 --- a/vendor/github.com/prometheus/procfs/fixtures/26231/stat +++ /dev/null @@ -1 +0,0 @@ -26231 (vim) R 5392 7446 5392 34835 7446 4218880 32533 309516 26 82 1677 44 158 99 20 0 1 0 82375 56274944 1981 18446744073709551615 4194304 6294284 140736914091744 140736914087944 139965136429984 0 0 12288 1870679807 0 0 0 17 0 0 0 31 0 0 8391624 8481048 16420864 140736914093252 140736914093279 140736914093279 140736914096107 0 diff --git a/vendor/github.com/prometheus/procfs/fixtures/584/stat b/vendor/github.com/prometheus/procfs/fixtures/584/stat deleted file mode 100644 index 65b9369d13e..00000000000 --- a/vendor/github.com/prometheus/procfs/fixtures/584/stat +++ /dev/null @@ -1,2 +0,0 @@ -1020 ((a b ) ( c d) ) R 28378 1020 28378 34842 1020 4218880 286 0 0 0 0 0 0 0 20 0 1 0 10839175 10395648 155 18446744073709551615 4194304 4238788 140736466511168 140736466511168 140609271124624 0 0 0 0 0 0 0 17 5 0 0 0 0 0 6336016 6337300 25579520 140736466515030 140736466515061 140736466515061 140736466518002 0 -#!/bin/cat /proc/self/stat diff --git a/vendor/github.com/prometheus/procfs/fixtures/stat b/vendor/github.com/prometheus/procfs/fixtures/stat deleted file mode 100644 index dabb96f7479..00000000000 --- a/vendor/github.com/prometheus/procfs/fixtures/stat +++ /dev/null @@ -1,16 +0,0 @@ -cpu 301854 612 111922 8979004 3552 2 3944 0 0 0 -cpu0 44490 19 21045 1087069 220 1 3410 0 0 0 -cpu1 47869 23 16474 1110787 591 0 46 0 0 0 -cpu2 46504 36 15916 1112321 441 0 326 0 0 0 -cpu3 47054 102 15683 1113230 533 0 60 0 0 0 -cpu4 28413 25 10776 1140321 217 0 8 0 0 0 -cpu5 29271 101 11586 1136270 672 0 30 0 0 0 -cpu6 29152 36 10276 1139721 319 0 29 0 0 0 -cpu7 29098 268 10164 1139282 555 0 31 0 0 0 -intr 8885917 17 0 0 0 0 0 0 0 1 79281 0 0 0 0 0 0 0 231237 0 0 0 0 250586 103 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 223424 190745 13 906 1283803 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -ctxt 38014093 -btime 1418183276 -processes 26442 -procs_running 2 -procs_blocked 0 -softirq 5057579 250191 1481983 1647 211099 186066 0 1783454 622196 12499 508444 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 3199837c20a..00000000000 --- 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/blockstorage/v1/pkg.go b/vendor/github.com/rackspace/gophercloud/acceptance/openstack/blockstorage/v1/pkg.go deleted file mode 100644 index 16d2567c3c8..00000000000 --- a/vendor/github.com/rackspace/gophercloud/acceptance/openstack/blockstorage/v1/pkg.go +++ /dev/null @@ -1,3 +0,0 @@ -// The v1 package contains acceptance tests for the Openstack Cinder V1 service. - -package v1 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 bb158c3eecc..00000000000 --- 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 f7ffc37b2f5..00000000000 --- 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 b7b1f993d55..00000000000 --- 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 5ec3cc8e833..00000000000 --- 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 eac3ae96a1f..00000000000 --- 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 1efac2c081a..00000000000 --- 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 206bf3313a8..00000000000 --- 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 27dfe5f8b7e..00000000000 --- 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 f5a7df7b751..00000000000 --- 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 aeec0fa756e..00000000000 --- 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 5ec3cc8e833..00000000000 --- 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 1eac681b571..00000000000 --- 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 2c28dcbcc98..00000000000 --- 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 11cfc805342..00000000000 --- 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 3a8ecdb100b..00000000000 --- 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 e9fdd992059..00000000000 --- 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 2333ca77bff..00000000000 --- 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 5ec3cc8e833..00000000000 --- 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 24512b99ae8..00000000000 --- 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 b7b1f993d55..00000000000 --- 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 5ec3cc8e833..00000000000 --- 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 4ce05e69ca8..00000000000 --- 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 81704187fef..00000000000 --- 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 1ae07278cce..00000000000 --- 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 b9d51979d7f..00000000000 --- 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 5d17b32caaa..00000000000 --- 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 8c753141745..00000000000 --- 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 f7eca1298a7..00000000000 --- 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 35679b728c3..00000000000 --- 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 e3af39f513a..00000000000 --- 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 bb2c2591584..00000000000 --- 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 7b0df115b50..00000000000 --- 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 78f9645bbec..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/blockstorage/v1/apiversions/urls.go +++ /dev/null @@ -1,18 +0,0 @@ -package apiversions - -import ( - "strings" - "net/url" - - "github.com/rackspace/gophercloud" -) - -func getURL(c *gophercloud.ServiceClient, version string) string { - return c.ServiceURL(strings.TrimRight(version, "/") + "/") -} - -func listURL(c *gophercloud.ServiceClient) string { - u, _ := url.Parse(c.ServiceURL("")) - u.Path = "/" - return u.String() -} 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 198f83077c5..00000000000 --- 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 d1461fb69d2..00000000000 --- 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 71936e51b64..00000000000 --- 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 e595798e4ae..00000000000 --- 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 4d635e8dd45..00000000000 --- 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 64cdc607ecd..00000000000 --- 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 2f66ba5e45a..00000000000 --- 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 3df7653f763..00000000000 --- 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 793084f89b2..00000000000 --- 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 e3326eae146..00000000000 --- 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 1673d13aaf3..00000000000 --- 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 c049a045d8c..00000000000 --- 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 cf8367bfab1..00000000000 --- 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 f78d4f73551..00000000000 --- 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 19b5ece4614..00000000000 --- 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 dd221bc983b..00000000000 --- 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 bef1da8a175..00000000000 --- 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 a95e18bca93..00000000000 --- 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 d4066985cb2..00000000000 --- 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 d7ec1a00d53..00000000000 --- 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 8755a95b8f9..00000000000 --- 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 8cab48b5367..00000000000 --- 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 6eb38d2939f..00000000000 --- 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 ceecaa5a5e4..00000000000 --- 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 5c6b5d00e49..00000000000 --- 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 1ddc65fafd3..00000000000 --- 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 1d8734b7c32..00000000000 --- 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 cb0aea8fca5..00000000000 --- 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 41f7c60dae2..00000000000 --- 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 359584c2a66..00000000000 --- 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 d9bc9f20b77..00000000000 --- 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 8b37928e219..00000000000 --- 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 33406c482b7..00000000000 --- 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 d953d4c1981..00000000000 --- 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 7b55795d08e..00000000000 --- 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 4a168f4b2c8..00000000000 --- 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 aeec0fa756e..00000000000 --- 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 0ed7de9f1d7..00000000000 --- 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 0b710850156..00000000000 --- 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 777d083fa07..00000000000 --- 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 6460c66bc01..00000000000 --- 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 2571a1a5a77..00000000000 --- 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 2870b6a9b7a..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/fixtures.go +++ /dev/null @@ -1,143 +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 mockCreateRuleResponseICMPZero(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": "ICMP", - "from_port": 0, - "to_port": 0, - "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": 0, - "id": "{ruleID}", - "ip_protocol": "ICMP", - "ip_range": { - "cidr": "10.10.12.0/24" - }, - "to_port": 0 - } -} -`) - }) -} - -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 d0098e600fc..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/defsecrules/requests.go +++ /dev/null @@ -1,96 +0,0 @@ -package defsecrules - -import ( - "errors" - "strings" - - "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 && strings.ToUpper(opts.IPProtocol) != "ICMP" { - return rule, errors.New("A FromPort must be set") - } - if opts.ToPort == 0 && strings.ToUpper(opts.IPProtocol) != "ICMP" { - 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 e588d3e3276..00000000000 --- 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 cc928ab8952..00000000000 --- 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 10079097b62..00000000000 --- 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/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/doc.go deleted file mode 100644 index 2b447da1d65..00000000000 --- 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/floatingip/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/doc.go deleted file mode 100644 index f74f58ce837..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package floatingip provides the ability to manage floating ips through -// nova-network -package floatingip diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/fixtures.go deleted file mode 100644 index e47fa4ccdba..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/fixtures.go +++ /dev/null @@ -1,193 +0,0 @@ -// +build fixtures - -package floatingip - -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 = ` -{ - "floating_ips": [ - { - "fixed_ip": null, - "id": 1, - "instance_id": null, - "ip": "10.10.10.1", - "pool": "nova" - }, - { - "fixed_ip": "166.78.185.201", - "id": 2, - "instance_id": "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - "ip": "10.10.10.2", - "pool": "nova" - } - ] -} -` - -// GetOutput is a sample response to a Get call. -const GetOutput = ` -{ - "floating_ip": { - "fixed_ip": "166.78.185.201", - "id": 2, - "instance_id": "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - "ip": "10.10.10.2", - "pool": "nova" - } -} -` - -// CreateOutput is a sample response to a Post call -const CreateOutput = ` -{ - "floating_ip": { - "fixed_ip": null, - "id": 1, - "instance_id": null, - "ip": "10.10.10.1", - "pool": "nova" - } -} -` - -// FirstFloatingIP is the first result in ListOutput. -var FirstFloatingIP = FloatingIP{ - ID: "1", - IP: "10.10.10.1", - Pool: "nova", -} - -// SecondFloatingIP is the first result in ListOutput. -var SecondFloatingIP = FloatingIP{ - FixedIP: "166.78.185.201", - ID: "2", - InstanceID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - IP: "10.10.10.2", - Pool: "nova", -} - -// ExpectedFloatingIPsSlice is the slice of results that should be parsed -// from ListOutput, in the expected order. -var ExpectedFloatingIPsSlice = []FloatingIP{FirstFloatingIP, SecondFloatingIP} - -// CreatedFloatingIP is the parsed result from CreateOutput. -var CreatedFloatingIP = FloatingIP{ - ID: "1", - IP: "10.10.10.1", - Pool: "nova", -} - -// HandleListSuccessfully configures the test server to respond to a List request. -func HandleListSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-floating-ips", 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 floating ip -func HandleGetSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-floating-ips/2", 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 floating ip -func HandleCreateSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-floating-ips", 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, ` -{ - "pool": "nova" -} -`) - - 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 floating ip -func HandleDeleteSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-floating-ips/1", 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) - }) -} - -// HandleAssociateSuccessfully configures the test server to respond to a Post request -// to associate an allocated floating IP -func HandleAssociateSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/servers/4d8c3732-a248-40ed-bebc-539a6ffd25c0/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, ` -{ - "addFloatingIp": { - "address": "10.10.10.2" - } -} -`) - - w.WriteHeader(http.StatusAccepted) - }) -} - -// HandleFixedAssociateSucessfully configures the test server to respond to a Post request -// to associate an allocated floating IP with a specific fixed IP address -func HandleAssociateFixedSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/servers/4d8c3732-a248-40ed-bebc-539a6ffd25c0/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, ` -{ - "addFloatingIp": { - "address": "10.10.10.2", - "fixed_address": "166.78.185.201" - } -} -`) - - w.WriteHeader(http.StatusAccepted) - }) -} - -// HandleDisassociateSuccessfully configures the test server to respond to a Post request -// to disassociate an allocated floating IP -func HandleDisassociateSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/servers/4d8c3732-a248-40ed-bebc-539a6ffd25c0/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, ` -{ - "removeFloatingIp": { - "address": "10.10.10.2" - } -} -`) - - w.WriteHeader(http.StatusAccepted) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/requests.go deleted file mode 100644 index 82064629774..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/requests.go +++ /dev/null @@ -1,171 +0,0 @@ -package floatingip - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager that allows you to iterate over a collection of FloatingIPs. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page { - return FloatingIPsPage{pagination.SinglePageBase(r)} - }) -} - -// CreateOptsBuilder describes struct types that can be accepted by the Create call. Notable, the -// CreateOpts struct in this package does. -type CreateOptsBuilder interface { - ToFloatingIPCreateMap() (map[string]interface{}, error) -} - -// CreateOpts specifies a Floating IP allocation request -type CreateOpts struct { - // Pool is the pool of floating IPs to allocate one from - Pool string -} - -// AssociateOpts specifies the required information to associate or disassociate a floating IP to an instance -type AssociateOpts struct { - // ServerID is the UUID of the server - ServerID string - - // FixedIP is an optional fixed IP address of the server - FixedIP string - - // FloatingIP is the floating IP to associate with an instance - FloatingIP string -} - -// ToFloatingIPCreateMap constructs a request body from CreateOpts. -func (opts CreateOpts) ToFloatingIPCreateMap() (map[string]interface{}, error) { - if opts.Pool == "" { - return nil, errors.New("Missing field required for floating IP creation: Pool") - } - - return map[string]interface{}{"pool": opts.Pool}, nil -} - -// ToAssociateMap constructs a request body from AssociateOpts. -func (opts AssociateOpts) ToAssociateMap() (map[string]interface{}, error) { - if opts.ServerID == "" { - return nil, errors.New("Required field missing for floating IP association: ServerID") - } - - if opts.FloatingIP == "" { - return nil, errors.New("Required field missing for floating IP association: FloatingIP") - } - - associateInfo := map[string]interface{}{ - "serverId": opts.ServerID, - "floatingIp": opts.FloatingIP, - "fixedIp": opts.FixedIP, - } - - return associateInfo, nil - -} - -// Create requests the creation of a new floating IP -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToFloatingIPCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Post(createURL(client), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// Get returns data about a previously created FloatingIP. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = client.Get(getURL(client, id), &res.Body, nil) - return res -} - -// Delete requests the deletion of a previous allocated FloatingIP. -func Delete(client *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - _, res.Err = client.Delete(deleteURL(client, id), nil) - return res -} - -// association / disassociation - -// Associate pairs an allocated floating IP with an instance -// Deprecated. Use AssociateInstance. -func Associate(client *gophercloud.ServiceClient, serverId, fip string) AssociateResult { - var res AssociateResult - - addFloatingIp := make(map[string]interface{}) - addFloatingIp["address"] = fip - reqBody := map[string]interface{}{"addFloatingIp": addFloatingIp} - - _, res.Err = client.Post(associateURL(client, serverId), reqBody, nil, nil) - return res -} - -// AssociateInstance pairs an allocated floating IP with an instance. -func AssociateInstance(client *gophercloud.ServiceClient, opts AssociateOpts) AssociateResult { - var res AssociateResult - - associateInfo, err := opts.ToAssociateMap() - if err != nil { - res.Err = err - return res - } - - addFloatingIp := make(map[string]interface{}) - addFloatingIp["address"] = associateInfo["floatingIp"].(string) - - // fixedIp is not required - if associateInfo["fixedIp"] != "" { - addFloatingIp["fixed_address"] = associateInfo["fixedIp"].(string) - } - - serverId := associateInfo["serverId"].(string) - - reqBody := map[string]interface{}{"addFloatingIp": addFloatingIp} - _, res.Err = client.Post(associateURL(client, serverId), reqBody, nil, nil) - return res -} - -// Disassociate decouples an allocated floating IP from an instance -// Deprecated. Use DisassociateInstance. -func Disassociate(client *gophercloud.ServiceClient, serverId, fip string) DisassociateResult { - var res DisassociateResult - - removeFloatingIp := make(map[string]interface{}) - removeFloatingIp["address"] = fip - reqBody := map[string]interface{}{"removeFloatingIp": removeFloatingIp} - - _, res.Err = client.Post(disassociateURL(client, serverId), reqBody, nil, nil) - return res -} - -// DisassociateInstance decouples an allocated floating IP from an instance -func DisassociateInstance(client *gophercloud.ServiceClient, opts AssociateOpts) DisassociateResult { - var res DisassociateResult - - associateInfo, err := opts.ToAssociateMap() - if err != nil { - res.Err = err - return res - } - - removeFloatingIp := make(map[string]interface{}) - removeFloatingIp["address"] = associateInfo["floatingIp"].(string) - reqBody := map[string]interface{}{"removeFloatingIp": removeFloatingIp} - - serverId := associateInfo["serverId"].(string) - - _, res.Err = client.Post(disassociateURL(client, serverId), reqBody, nil, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/results.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/results.go deleted file mode 100644 index be77fa17922..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/results.go +++ /dev/null @@ -1,99 +0,0 @@ -package floatingip - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// A FloatingIP is an IP that can be associated with an instance -type FloatingIP struct { - // ID is a unique ID of the Floating IP - ID string `mapstructure:"id"` - - // FixedIP is the IP of the instance related to the Floating IP - FixedIP string `mapstructure:"fixed_ip,omitempty"` - - // InstanceID is the ID of the instance that is using the Floating IP - InstanceID string `mapstructure:"instance_id"` - - // IP is the actual Floating IP - IP string `mapstructure:"ip"` - - // Pool is the pool of floating IPs that this floating IP belongs to - Pool string `mapstructure:"pool"` -} - -// FloatingIPsPage stores a single, only page of FloatingIPs -// results from a List call. -type FloatingIPsPage struct { - pagination.SinglePageBase -} - -// IsEmpty determines whether or not a FloatingIPsPage is empty. -func (page FloatingIPsPage) IsEmpty() (bool, error) { - va, err := ExtractFloatingIPs(page) - return len(va) == 0, err -} - -// ExtractFloatingIPs interprets a page of results as a slice of -// FloatingIPs. -func ExtractFloatingIPs(page pagination.Page) ([]FloatingIP, error) { - casted := page.(FloatingIPsPage).Body - var response struct { - FloatingIPs []FloatingIP `mapstructure:"floating_ips"` - } - - err := mapstructure.WeakDecode(casted, &response) - - return response.FloatingIPs, err -} - -type FloatingIPResult struct { - gophercloud.Result -} - -// Extract is a method that attempts to interpret any FloatingIP resource -// response as a FloatingIP struct. -func (r FloatingIPResult) Extract() (*FloatingIP, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - FloatingIP *FloatingIP `json:"floating_ip" mapstructure:"floating_ip"` - } - - err := mapstructure.WeakDecode(r.Body, &res) - return res.FloatingIP, err -} - -// CreateResult is the response from a Create operation. Call its Extract method to interpret it -// as a FloatingIP. -type CreateResult struct { - FloatingIPResult -} - -// GetResult is the response from a Get operation. Call its Extract method to interpret it -// as a FloatingIP. -type GetResult struct { - FloatingIPResult -} - -// DeleteResult is the response from a Delete operation. Call its Extract method to determine if -// the call succeeded or failed. -type DeleteResult struct { - gophercloud.ErrResult -} - -// AssociateResult is the response from a Delete operation. Call its Extract method to determine if -// the call succeeded or failed. -type AssociateResult struct { - gophercloud.ErrResult -} - -// DisassociateResult is the response from a Delete operation. Call its Extract method to determine if -// the call succeeded or failed. -type DisassociateResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/urls.go deleted file mode 100644 index 54198f85291..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip/urls.go +++ /dev/null @@ -1,37 +0,0 @@ -package floatingip - -import "github.com/rackspace/gophercloud" - -const resourcePath = "os-floating-ips" - -func resourceURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(resourcePath) -} - -func listURL(c *gophercloud.ServiceClient) string { - return resourceURL(c) -} - -func createURL(c *gophercloud.ServiceClient) string { - return resourceURL(c) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(resourcePath, id) -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return getURL(c, id) -} - -func serverURL(c *gophercloud.ServiceClient, serverId string) string { - return c.ServiceURL("servers/" + serverId + "/action") -} - -func associateURL(c *gophercloud.ServiceClient, serverId string) string { - return serverURL(c, serverId) -} - -func disassociateURL(c *gophercloud.ServiceClient, serverId string) string { - return serverURL(c, serverId) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/doc.go deleted file mode 100644 index 856f41bacc9..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package keypairs provides information and interaction with the Keypairs -// extension for the OpenStack Compute service. -package keypairs diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/fixtures.go deleted file mode 100644 index d10af99d0eb..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/fixtures.go +++ /dev/null @@ -1,171 +0,0 @@ -// +build fixtures - -package keypairs - -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 = ` -{ - "keypairs": [ - { - "keypair": { - "fingerprint": "15:b0:f8:b3:f9:48:63:71:cf:7b:5b:38:6d:44:2d:4a", - "name": "firstkey", - "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC+Eo/RZRngaGTkFs7I62ZjsIlO79KklKbMXi8F+KITD4bVQHHn+kV+4gRgkgCRbdoDqoGfpaDFs877DYX9n4z6FrAIZ4PES8TNKhatifpn9NdQYWA+IkU8CuvlEKGuFpKRi/k7JLos/gHi2hy7QUwgtRvcefvD/vgQZOVw/mGR9Q== Generated by Nova\n" - } - }, - { - "keypair": { - "fingerprint": "35:9d:d0:c3:4a:80:d3:d8:86:f1:ca:f7:df:c4:f9:d8", - "name": "secondkey", - "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC9mC3WZN9UGLxgPBpP7H5jZMc6pKwOoSgre8yun6REFktn/Kz7DUt9jaR1UJyRzHxITfCfAIgSxPdGqB/oF1suMyWgu5i0625vavLB5z5kC8Hq3qZJ9zJO1poE1kyD+htiTtPWJ88e12xuH2XB/CZN9OpEiF98hAagiOE0EnOS5Q== Generated by Nova\n" - } - } - ] -} -` - -// GetOutput is a sample response to a Get call. -const GetOutput = ` -{ - "keypair": { - "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC+Eo/RZRngaGTkFs7I62ZjsIlO79KklKbMXi8F+KITD4bVQHHn+kV+4gRgkgCRbdoDqoGfpaDFs877DYX9n4z6FrAIZ4PES8TNKhatifpn9NdQYWA+IkU8CuvlEKGuFpKRi/k7JLos/gHi2hy7QUwgtRvcefvD/vgQZOVw/mGR9Q== Generated by Nova\n", - "name": "firstkey", - "fingerprint": "15:b0:f8:b3:f9:48:63:71:cf:7b:5b:38:6d:44:2d:4a" - } -} -` - -// CreateOutput is a sample response to a Create call. -const CreateOutput = ` -{ - "keypair": { - "fingerprint": "35:9d:d0:c3:4a:80:d3:d8:86:f1:ca:f7:df:c4:f9:d8", - "name": "createdkey", - "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQC9mC3WZN9UGLxgPBpP7H5jZMc6pKwOoSgre8yun6REFktn/Kz7\nDUt9jaR1UJyRzHxITfCfAIgSxPdGqB/oF1suMyWgu5i0625vavLB5z5kC8Hq3qZJ\n9zJO1poE1kyD+htiTtPWJ88e12xuH2XB/CZN9OpEiF98hAagiOE0EnOS5QIDAQAB\nAoGAE5XO1mDhORy9COvsg+kYPUhB1GsCYxh+v88wG7HeFDKBY6KUc/Kxo6yoGn5T\nTjRjekyi2KoDZHz4VlIzyZPwFS4I1bf3oCunVoAKzgLdmnTtvRNMC5jFOGc2vUgP\n9bSyRj3S1R4ClVk2g0IDeagko/jc8zzLEYuIK+fbkds79YECQQDt3vcevgegnkga\ntF4NsDmmBPRkcSHCqrANP/7vFcBQN3czxeYYWX3DK07alu6GhH1Y4sHbdm616uU0\nll7xbDzxAkEAzAtN2IyftNygV2EGiaGgqLyo/tD9+Vui2qCQplqe4jvWh/5Sparl\nOjmKo+uAW+hLrLVMnHzRWxbWU8hirH5FNQJATO+ZxCK4etXXAnQmG41NCAqANWB2\nB+2HJbH2NcQ2QHvAHUm741JGn/KI/aBlo7KEjFRDWUVUB5ji64BbUwCsMQJBAIku\nLGcjnBf/oLk+XSPZC2eGd2Ph5G5qYmH0Q2vkTx+wtTn3DV+eNsDfgMtWAJVJ5t61\ngU1QSXyhLPVlKpnnxuUCQC+xvvWjWtsLaFtAsZywJiqLxQzHts8XLGZptYJ5tLWV\nrtmYtBcJCN48RrgQHry/xWYeA4K/AFQpXfNPgprQ96Q=\n-----END RSA PRIVATE KEY-----\n", - "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC9mC3WZN9UGLxgPBpP7H5jZMc6pKwOoSgre8yun6REFktn/Kz7DUt9jaR1UJyRzHxITfCfAIgSxPdGqB/oF1suMyWgu5i0625vavLB5z5kC8Hq3qZJ9zJO1poE1kyD+htiTtPWJ88e12xuH2XB/CZN9OpEiF98hAagiOE0EnOS5Q== Generated by Nova\n", - "user_id": "fake" - } -} -` - -// ImportOutput is a sample response to a Create call that provides its own public key. -const ImportOutput = ` -{ - "keypair": { - "fingerprint": "1e:2c:9b:56:79:4b:45:77:f9:ca:7a:98:2c:b0:d5:3c", - "name": "importedkey", - "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova", - "user_id": "fake" - } -} -` - -// FirstKeyPair is the first result in ListOutput. -var FirstKeyPair = KeyPair{ - Name: "firstkey", - Fingerprint: "15:b0:f8:b3:f9:48:63:71:cf:7b:5b:38:6d:44:2d:4a", - PublicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC+Eo/RZRngaGTkFs7I62ZjsIlO79KklKbMXi8F+KITD4bVQHHn+kV+4gRgkgCRbdoDqoGfpaDFs877DYX9n4z6FrAIZ4PES8TNKhatifpn9NdQYWA+IkU8CuvlEKGuFpKRi/k7JLos/gHi2hy7QUwgtRvcefvD/vgQZOVw/mGR9Q== Generated by Nova\n", -} - -// SecondKeyPair is the second result in ListOutput. -var SecondKeyPair = KeyPair{ - Name: "secondkey", - Fingerprint: "35:9d:d0:c3:4a:80:d3:d8:86:f1:ca:f7:df:c4:f9:d8", - PublicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC9mC3WZN9UGLxgPBpP7H5jZMc6pKwOoSgre8yun6REFktn/Kz7DUt9jaR1UJyRzHxITfCfAIgSxPdGqB/oF1suMyWgu5i0625vavLB5z5kC8Hq3qZJ9zJO1poE1kyD+htiTtPWJ88e12xuH2XB/CZN9OpEiF98hAagiOE0EnOS5Q== Generated by Nova\n", -} - -// ExpectedKeyPairSlice is the slice of results that should be parsed from ListOutput, in the expected -// order. -var ExpectedKeyPairSlice = []KeyPair{FirstKeyPair, SecondKeyPair} - -// CreatedKeyPair is the parsed result from CreatedOutput. -var CreatedKeyPair = KeyPair{ - Name: "createdkey", - Fingerprint: "35:9d:d0:c3:4a:80:d3:d8:86:f1:ca:f7:df:c4:f9:d8", - PublicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC9mC3WZN9UGLxgPBpP7H5jZMc6pKwOoSgre8yun6REFktn/Kz7DUt9jaR1UJyRzHxITfCfAIgSxPdGqB/oF1suMyWgu5i0625vavLB5z5kC8Hq3qZJ9zJO1poE1kyD+htiTtPWJ88e12xuH2XB/CZN9OpEiF98hAagiOE0EnOS5Q== Generated by Nova\n", - PrivateKey: "-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQC9mC3WZN9UGLxgPBpP7H5jZMc6pKwOoSgre8yun6REFktn/Kz7\nDUt9jaR1UJyRzHxITfCfAIgSxPdGqB/oF1suMyWgu5i0625vavLB5z5kC8Hq3qZJ\n9zJO1poE1kyD+htiTtPWJ88e12xuH2XB/CZN9OpEiF98hAagiOE0EnOS5QIDAQAB\nAoGAE5XO1mDhORy9COvsg+kYPUhB1GsCYxh+v88wG7HeFDKBY6KUc/Kxo6yoGn5T\nTjRjekyi2KoDZHz4VlIzyZPwFS4I1bf3oCunVoAKzgLdmnTtvRNMC5jFOGc2vUgP\n9bSyRj3S1R4ClVk2g0IDeagko/jc8zzLEYuIK+fbkds79YECQQDt3vcevgegnkga\ntF4NsDmmBPRkcSHCqrANP/7vFcBQN3czxeYYWX3DK07alu6GhH1Y4sHbdm616uU0\nll7xbDzxAkEAzAtN2IyftNygV2EGiaGgqLyo/tD9+Vui2qCQplqe4jvWh/5Sparl\nOjmKo+uAW+hLrLVMnHzRWxbWU8hirH5FNQJATO+ZxCK4etXXAnQmG41NCAqANWB2\nB+2HJbH2NcQ2QHvAHUm741JGn/KI/aBlo7KEjFRDWUVUB5ji64BbUwCsMQJBAIku\nLGcjnBf/oLk+XSPZC2eGd2Ph5G5qYmH0Q2vkTx+wtTn3DV+eNsDfgMtWAJVJ5t61\ngU1QSXyhLPVlKpnnxuUCQC+xvvWjWtsLaFtAsZywJiqLxQzHts8XLGZptYJ5tLWV\nrtmYtBcJCN48RrgQHry/xWYeA4K/AFQpXfNPgprQ96Q=\n-----END RSA PRIVATE KEY-----\n", - UserID: "fake", -} - -// ImportedKeyPair is the parsed result from ImportOutput. -var ImportedKeyPair = KeyPair{ - Name: "importedkey", - Fingerprint: "1e:2c:9b:56:79:4b:45:77:f9:ca:7a:98:2c:b0:d5:3c", - PublicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova", - UserID: "fake", -} - -// HandleListSuccessfully configures the test server to respond to a List request. -func HandleListSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-keypairs", 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 "firstkey". -func HandleGetSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-keypairs/firstkey", 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 -// keypair called "createdkey". -func HandleCreateSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-keypairs", 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, `{ "keypair": { "name": "createdkey" } }`) - - w.Header().Add("Content-Type", "application/json") - fmt.Fprintf(w, CreateOutput) - }) -} - -// HandleImportSuccessfully configures the test server to respond to an Import request for an -// existing keypair called "importedkey". -func HandleImportSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-keypairs", 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, ` - { - "keypair": { - "name": "importedkey", - "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDx8nkQv/zgGgB4rMYmIf+6A4l6Rr+o/6lHBQdW5aYd44bd8JttDCE/F/pNRr0lRE+PiqSPO8nDPHw0010JeMH9gYgnnFlyY3/OcJ02RhIPyyxYpv9FhY+2YiUkpwFOcLImyrxEsYXpD/0d3ac30bNH6Sw9JD9UZHYcpSxsIbECHw== Generated by Nova" - } - } - `) - - w.Header().Add("Content-Type", "application/json") - fmt.Fprintf(w, ImportOutput) - }) -} - -// HandleDeleteSuccessfully configures the test server to respond to a Delete request for a -// keypair called "deletedkey". -func HandleDeleteSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-keypairs/deletedkey", 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/compute/v2/extensions/keypairs/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/requests.go deleted file mode 100644 index c56ee67ea2d..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/requests.go +++ /dev/null @@ -1,102 +0,0 @@ -package keypairs - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/compute/v2/servers" - "github.com/rackspace/gophercloud/pagination" -) - -// CreateOptsExt adds a KeyPair option to the base CreateOpts. -type CreateOptsExt struct { - servers.CreateOptsBuilder - KeyName string `json:"key_name,omitempty"` -} - -// ToServerCreateMap adds the key_name and, optionally, key_data options 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 opts.KeyName == "" { - return base, nil - } - - serverMap := base["server"].(map[string]interface{}) - serverMap["key_name"] = opts.KeyName - - return base, nil -} - -// List returns a Pager that allows you to iterate over a collection of KeyPairs. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page { - return KeyPairPage{pagination.SinglePageBase(r)} - }) -} - -// CreateOptsBuilder describes struct types that can be accepted by the Create call. Notable, the -// CreateOpts struct in this package does. -type CreateOptsBuilder interface { - ToKeyPairCreateMap() (map[string]interface{}, error) -} - -// CreateOpts specifies keypair creation or import parameters. -type CreateOpts struct { - // Name [required] is a friendly name to refer to this KeyPair in other services. - Name string - - // PublicKey [optional] is a pregenerated OpenSSH-formatted public key. If provided, this key - // will be imported and no new key will be created. - PublicKey string -} - -// ToKeyPairCreateMap constructs a request body from CreateOpts. -func (opts CreateOpts) ToKeyPairCreateMap() (map[string]interface{}, error) { - if opts.Name == "" { - return nil, errors.New("Missing field required for keypair creation: Name") - } - - keypair := make(map[string]interface{}) - keypair["name"] = opts.Name - if opts.PublicKey != "" { - keypair["public_key"] = opts.PublicKey - } - - return map[string]interface{}{"keypair": keypair}, nil -} - -// Create requests the creation of a new keypair on the server, or to import a pre-existing -// keypair. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToKeyPairCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Post(createURL(client), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// Get returns public data about a previously uploaded KeyPair. -func Get(client *gophercloud.ServiceClient, name string) GetResult { - var res GetResult - _, res.Err = client.Get(getURL(client, name), &res.Body, nil) - return res -} - -// Delete requests the deletion of a previous stored KeyPair from the server. -func Delete(client *gophercloud.ServiceClient, name string) DeleteResult { - var res DeleteResult - _, res.Err = client.Delete(deleteURL(client, name), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/results.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/results.go deleted file mode 100644 index f1a0d8e114c..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/results.go +++ /dev/null @@ -1,94 +0,0 @@ -package keypairs - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// KeyPair is an SSH key known to the OpenStack cluster that is available to be injected into -// servers. -type KeyPair struct { - // Name is used to refer to this keypair from other services within this region. - Name string `mapstructure:"name"` - - // Fingerprint is a short sequence of bytes that can be used to authenticate or validate a longer - // public key. - Fingerprint string `mapstructure:"fingerprint"` - - // PublicKey is the public key from this pair, in OpenSSH format. "ssh-rsa AAAAB3Nz..." - PublicKey string `mapstructure:"public_key"` - - // PrivateKey is the private key from this pair, in PEM format. - // "-----BEGIN RSA PRIVATE KEY-----\nMIICXA..." It is only present if this keypair was just - // returned from a Create call - PrivateKey string `mapstructure:"private_key"` - - // UserID is the user who owns this keypair. - UserID string `mapstructure:"user_id"` -} - -// KeyPairPage stores a single, only page of KeyPair results from a List call. -type KeyPairPage struct { - pagination.SinglePageBase -} - -// IsEmpty determines whether or not a KeyPairPage is empty. -func (page KeyPairPage) IsEmpty() (bool, error) { - ks, err := ExtractKeyPairs(page) - return len(ks) == 0, err -} - -// ExtractKeyPairs interprets a page of results as a slice of KeyPairs. -func ExtractKeyPairs(page pagination.Page) ([]KeyPair, error) { - type pair struct { - KeyPair KeyPair `mapstructure:"keypair"` - } - - var resp struct { - KeyPairs []pair `mapstructure:"keypairs"` - } - - err := mapstructure.Decode(page.(KeyPairPage).Body, &resp) - results := make([]KeyPair, len(resp.KeyPairs)) - for i, pair := range resp.KeyPairs { - results[i] = pair.KeyPair - } - return results, err -} - -type keyPairResult struct { - gophercloud.Result -} - -// Extract is a method that attempts to interpret any KeyPair resource response as a KeyPair struct. -func (r keyPairResult) Extract() (*KeyPair, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - KeyPair *KeyPair `json:"keypair" mapstructure:"keypair"` - } - - err := mapstructure.Decode(r.Body, &res) - return res.KeyPair, err -} - -// CreateResult is the response from a Create operation. Call its Extract method to interpret it -// as a KeyPair. -type CreateResult struct { - keyPairResult -} - -// GetResult is the response from a Get operation. Call its Extract method to interpret it -// as a KeyPair. -type GetResult struct { - keyPairResult -} - -// DeleteResult is the response from a Delete operation. Call its Extract method to determine if -// the call succeeded or failed. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/urls.go deleted file mode 100644 index 702f5329e05..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs/urls.go +++ /dev/null @@ -1,25 +0,0 @@ -package keypairs - -import "github.com/rackspace/gophercloud" - -const resourcePath = "os-keypairs" - -func resourceURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(resourcePath) -} - -func listURL(c *gophercloud.ServiceClient) string { - return resourceURL(c) -} - -func createURL(c *gophercloud.ServiceClient) string { - return resourceURL(c) -} - -func getURL(c *gophercloud.ServiceClient, name string) string { - return c.ServiceURL(resourcePath, name) -} - -func deleteURL(c *gophercloud.ServiceClient, name string) string { - return getURL(c, name) -} 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 fafe4a04d74..00000000000 --- 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 12b94859b16..00000000000 --- 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 eb203878ba0..00000000000 --- 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 55b361d7fc9..00000000000 --- 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 69664620aff..00000000000 --- 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/quotasets/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/doc.go deleted file mode 100644 index 721024ec58f..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package quotasets provides information and interaction with QuotaSet -// extension for the OpenStack Compute service. -package quotasets diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/fixtures.go deleted file mode 100644 index c1bb4ea4ff7..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/fixtures.go +++ /dev/null @@ -1,59 +0,0 @@ -// +build fixtures - -package quotasets - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - "github.com/rackspace/gophercloud/testhelper/client" -) - -// GetOutput is a sample response to a Get call. -const GetOutput = ` -{ - "quota_set" : { - "instances" : 25, - "security_groups" : 10, - "security_group_rules" : 20, - "cores" : 200, - "injected_file_content_bytes" : 10240, - "injected_files" : 5, - "metadata_items" : 128, - "ram" : 200000, - "keypairs" : 10, - "injected_file_path_bytes" : 255 - } -} -` - -const FirstTenantID = "555544443333222211110000ffffeeee" - -// FirstQuotaSet is the first result in ListOutput. -var FirstQuotaSet = QuotaSet{ - FixedIps: 0, - FloatingIps: 0, - InjectedFileContentBytes: 10240, - InjectedFilePathBytes: 255, - InjectedFiles: 5, - KeyPairs: 10, - MetadataItems: 128, - Ram: 200000, - SecurityGroupRules: 20, - SecurityGroups: 10, - Cores: 200, - Instances: 25, -} - -// HandleGetSuccessfully configures the test server to respond to a Get request for sample tenant -func HandleGetSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-quota-sets/"+FirstTenantID, 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/quotasets/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/requests.go deleted file mode 100644 index 52f08391598..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/requests.go +++ /dev/null @@ -1,12 +0,0 @@ -package quotasets - -import ( - "github.com/rackspace/gophercloud" -) - -// Get returns public data about a previously created QuotaSet. -func Get(client *gophercloud.ServiceClient, tenantID string) GetResult { - var res GetResult - _, res.Err = client.Get(getURL(client, tenantID), &res.Body, nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/results.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/results.go deleted file mode 100644 index cbf4d6b82c9..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/results.go +++ /dev/null @@ -1,86 +0,0 @@ -package quotasets - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// QuotaSet is a set of operational limits that allow for control of compute usage. -type QuotaSet struct { - //ID is tenant associated with this quota_set - ID string `mapstructure:"id"` - //FixedIps is number of fixed ips alloted this quota_set - FixedIps int `mapstructure:"fixed_ips"` - // FloatingIps is number of floating ips alloted this quota_set - FloatingIps int `mapstructure:"floating_ips"` - // InjectedFileContentBytes is content bytes allowed for each injected file - InjectedFileContentBytes int `mapstructure:"injected_file_content_bytes"` - // InjectedFilePathBytes is allowed bytes for each injected file path - InjectedFilePathBytes int `mapstructure:"injected_file_path_bytes"` - // InjectedFiles is injected files allowed for each project - InjectedFiles int `mapstructure:"injected_files"` - // KeyPairs is number of ssh keypairs - KeyPairs int `mapstructure:"keypairs"` - // MetadataItems is number of metadata items allowed for each instance - MetadataItems int `mapstructure:"metadata_items"` - // Ram is megabytes allowed for each instance - Ram int `mapstructure:"ram"` - // SecurityGroupRules is rules allowed for each security group - SecurityGroupRules int `mapstructure:"security_group_rules"` - // SecurityGroups security groups allowed for each project - SecurityGroups int `mapstructure:"security_groups"` - // Cores is number of instance cores allowed for each project - Cores int `mapstructure:"cores"` - // Instances is number of instances allowed for each project - Instances int `mapstructure:"instances"` -} - -// QuotaSetPage stores a single, only page of QuotaSet results from a List call. -type QuotaSetPage struct { - pagination.SinglePageBase -} - -// IsEmpty determines whether or not a QuotaSetsetPage is empty. -func (page QuotaSetPage) IsEmpty() (bool, error) { - ks, err := ExtractQuotaSets(page) - return len(ks) == 0, err -} - -// ExtractQuotaSets interprets a page of results as a slice of QuotaSets. -func ExtractQuotaSets(page pagination.Page) ([]QuotaSet, error) { - var resp struct { - QuotaSets []QuotaSet `mapstructure:"quotas"` - } - - err := mapstructure.Decode(page.(QuotaSetPage).Body, &resp) - results := make([]QuotaSet, len(resp.QuotaSets)) - for i, q := range resp.QuotaSets { - results[i] = q - } - return results, err -} - -type quotaResult struct { - gophercloud.Result -} - -// Extract is a method that attempts to interpret any QuotaSet resource response as a QuotaSet struct. -func (r quotaResult) Extract() (*QuotaSet, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - QuotaSet *QuotaSet `json:"quota_set" mapstructure:"quota_set"` - } - - err := mapstructure.Decode(r.Body, &res) - return res.QuotaSet, err -} - -// GetResult is the response from a Get operation. Call its Extract method to interpret it -// as a QuotaSet. -type GetResult struct { - quotaResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/urls.go deleted file mode 100644 index c04d94122c2..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/quotasets/urls.go +++ /dev/null @@ -1,13 +0,0 @@ -package quotasets - -import "github.com/rackspace/gophercloud" - -const resourcePath = "os-quota-sets" - -func resourceURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(resourcePath) -} - -func getURL(c *gophercloud.ServiceClient, tenantID string) string { - return c.ServiceURL(resourcePath, tenantID) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/doc.go deleted file mode 100644 index 0bd45661b56..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package schedulerhints enables instances to provide the OpenStack scheduler -// hints about where they should be placed in the cloud. -package schedulerhints diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests.go deleted file mode 100644 index 567eef41a11..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests.go +++ /dev/null @@ -1,134 +0,0 @@ -package schedulerhints - -import ( - "fmt" - "net" - "regexp" - "strings" - - "github.com/rackspace/gophercloud/openstack/compute/v2/servers" -) - -// SchedulerHints represents a set of scheduling hints that are passed to the -// OpenStack scheduler -type SchedulerHints struct { - // Group specifies a Server Group to place the instance in. - Group string - - // DifferentHost will place the instance on a compute node that does not - // host the given instances. - DifferentHost []string - - // SameHost will place the instance on a compute node that hosts the given - // instances. - SameHost []string - - // Query is a conditional statement that results in compute nodes able to - // host the instance. - Query []interface{} - - // TargetCell specifies a cell name where the instance will be placed. - TargetCell string - - // BuildNearHostIP specifies a subnet of compute nodes to host the instance. - BuildNearHostIP string -} - -// SchedulerHintsBuilder builds the scheduler hints into a serializable format. -type SchedulerHintsBuilder interface { - ToServerSchedulerHintsMap() (map[string]interface{}, error) -} - -// ToServerSchedulerHintsMap builds the scheduler hints into a serializable format. -func (opts SchedulerHints) ToServerSchedulerHintsMap() (map[string]interface{}, error) { - sh := make(map[string]interface{}) - - uuidRegex, _ := regexp.Compile("^[a-z0-9]{8}-[a-z0-9]{4}-[1-5][a-z0-9]{3}-[a-z0-9]{4}-[a-z0-9]{12}$") - - if opts.Group != "" { - if !uuidRegex.MatchString(opts.Group) { - return nil, fmt.Errorf("Group must be a UUID") - } - sh["group"] = opts.Group - } - - if len(opts.DifferentHost) > 0 { - for _, diffHost := range opts.DifferentHost { - if !uuidRegex.MatchString(diffHost) { - return nil, fmt.Errorf("The hosts in DifferentHost must be in UUID format.") - } - } - sh["different_host"] = opts.DifferentHost - } - - if len(opts.SameHost) > 0 { - for _, sameHost := range opts.SameHost { - if !uuidRegex.MatchString(sameHost) { - return nil, fmt.Errorf("The hosts in SameHost must be in UUID format.") - } - } - sh["same_host"] = opts.SameHost - } - - /* Query can be something simple like: - [">=", "$free_ram_mb", 1024] - - Or more complex like: - ['and', - ['>=', '$free_ram_mb', 1024], - ['>=', '$free_disk_mb', 200 * 1024] - ] - - Because of the possible complexity, just make sure the length is a minimum of 3. - */ - if len(opts.Query) > 0 { - if len(opts.Query) < 3 { - return nil, fmt.Errorf("Query must be a conditional statement in the format of [op,variable,value]") - } - sh["query"] = opts.Query - } - - if opts.TargetCell != "" { - sh["target_cell"] = opts.TargetCell - } - - if opts.BuildNearHostIP != "" { - if _, _, err := net.ParseCIDR(opts.BuildNearHostIP); err != nil { - return nil, fmt.Errorf("BuildNearHostIP must be a valid subnet in the form 192.168.1.1/24") - } - ipParts := strings.Split(opts.BuildNearHostIP, "/") - sh["build_near_host_ip"] = ipParts[0] - sh["cidr"] = "/" + ipParts[1] - } - - return sh, nil -} - -// CreateOptsExt adds a SchedulerHints option to the base CreateOpts. -type CreateOptsExt struct { - servers.CreateOptsBuilder - - // SchedulerHints provides a set of hints to the scheduler. - SchedulerHints SchedulerHintsBuilder -} - -// ToServerCreateMap adds the SchedulerHints 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 - } - - schedulerHints, err := opts.SchedulerHints.ToServerSchedulerHintsMap() - if err != nil { - return nil, err - } - - if len(schedulerHints) == 0 { - return base, nil - } - - base["os:scheduler_hints"] = schedulerHints - - return base, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/doc.go deleted file mode 100644 index 702f32c9854..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/doc.go +++ /dev/null @@ -1 +0,0 @@ -package secgroups diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/fixtures.go deleted file mode 100644 index 28b1c064497..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/fixtures.go +++ /dev/null @@ -1,303 +0,0 @@ -package secgroups - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -const rootPath = "/os-security-groups" - -const listGroupsJSON = ` -{ - "security_groups": [ - { - "description": "default", - "id": "{groupID}", - "name": "default", - "rules": [], - "tenant_id": "openstack" - } - ] -} -` - -func mockListGroupsResponse(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, listGroupsJSON) - }) -} - -func mockListGroupsByServerResponse(t *testing.T, serverID string) { - url := fmt.Sprintf("/servers/%s%s", serverID, rootPath) - 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, listGroupsJSON) - }) -} - -func mockCreateGroupResponse(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": { - "name": "test", - "description": "something" - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "security_group": { - "description": "something", - "id": "{groupID}", - "name": "test", - "rules": [], - "tenant_id": "openstack" - } -} -`) - }) -} - -func mockUpdateGroupResponse(t *testing.T, groupID string) { - url := fmt.Sprintf("%s/%s", rootPath, groupID) - th.Mux.HandleFunc(url, 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, ` -{ - "security_group": { - "name": "new_name", - "description": "new_desc" - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "security_group": { - "description": "something", - "id": "{groupID}", - "name": "new_name", - "rules": [], - "tenant_id": "openstack" - } -} -`) - }) -} - -func mockGetGroupsResponse(t *testing.T, groupID string) { - url := fmt.Sprintf("%s/%s", rootPath, groupID) - 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": { - "description": "default", - "id": "{groupID}", - "name": "default", - "rules": [ - { - "from_port": 80, - "group": { - "tenant_id": "openstack", - "name": "default" - }, - "ip_protocol": "TCP", - "to_port": 85, - "parent_group_id": "{groupID}", - "ip_range": { - "cidr": "0.0.0.0" - }, - "id": "{ruleID}" - } - ], - "tenant_id": "openstack" - } -} - `) - }) -} - -func mockGetNumericIDGroupResponse(t *testing.T, groupID int) { - url := fmt.Sprintf("%s/%d", rootPath, groupID) - 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": { - "id": 12345 - } -} - `) - }) -} - -func mockDeleteGroupResponse(t *testing.T, groupID string) { - url := fmt.Sprintf("%s/%s", rootPath, groupID) - 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.StatusAccepted) - }) -} - -func mockAddRuleResponse(t *testing.T) { - th.Mux.HandleFunc("/os-security-group-rules", 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_rule": { - "from_port": 22, - "ip_protocol": "TCP", - "to_port": 22, - "parent_group_id": "{groupID}", - "cidr": "0.0.0.0/0" - } -} `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "security_group_rule": { - "from_port": 22, - "group": {}, - "ip_protocol": "TCP", - "to_port": 22, - "parent_group_id": "{groupID}", - "ip_range": { - "cidr": "0.0.0.0/0" - }, - "id": "{ruleID}" - } -}`) - }) -} - -func mockAddRuleResponseICMPZero(t *testing.T) { - th.Mux.HandleFunc("/os-security-group-rules", 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_rule": { - "from_port": 0, - "ip_protocol": "ICMP", - "to_port": 0, - "parent_group_id": "{groupID}", - "cidr": "0.0.0.0/0" - } -} `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - - fmt.Fprintf(w, ` -{ - "security_group_rule": { - "from_port": 0, - "group": {}, - "ip_protocol": "ICMP", - "to_port": 0, - "parent_group_id": "{groupID}", - "ip_range": { - "cidr": "0.0.0.0/0" - }, - "id": "{ruleID}" - } -}`) - }) -} - -func mockDeleteRuleResponse(t *testing.T, ruleID string) { - url := fmt.Sprintf("/os-security-group-rules/%s", 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.StatusAccepted) - }) -} - -func mockAddServerToGroupResponse(t *testing.T, serverID string) { - url := fmt.Sprintf("/servers/%s/action", serverID) - th.Mux.HandleFunc(url, 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, ` -{ - "addSecurityGroup": { - "name": "test" - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusAccepted) - fmt.Fprintf(w, `{}`) - }) -} - -func mockRemoveServerFromGroupResponse(t *testing.T, serverID string) { - url := fmt.Sprintf("/servers/%s/action", serverID) - th.Mux.HandleFunc(url, 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, ` -{ - "removeSecurityGroup": { - "name": "test" - } -} - `) - - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(http.StatusAccepted) - fmt.Fprintf(w, `{}`) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/requests.go deleted file mode 100644 index 120dcae3c8c..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/requests.go +++ /dev/null @@ -1,258 +0,0 @@ -package secgroups - -import ( - "errors" - "strings" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -func commonList(client *gophercloud.ServiceClient, url string) pagination.Pager { - createPage := func(r pagination.PageResult) pagination.Page { - return SecurityGroupPage{pagination.SinglePageBase(r)} - } - - return pagination.NewPager(client, url, createPage) -} - -// List will return a collection of all the security groups for a particular -// tenant. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return commonList(client, rootURL(client)) -} - -// ListByServer will return a collection of all the security groups which are -// associated with a particular server. -func ListByServer(client *gophercloud.ServiceClient, serverID string) pagination.Pager { - return commonList(client, listByServerURL(client, serverID)) -} - -// GroupOpts is the underlying struct responsible for creating or updating -// security groups. It therefore represents the mutable attributes of a -// security group. -type GroupOpts struct { - // Required - the name of your security group. - Name string `json:"name"` - - // Required - the description of your security group. - Description string `json:"description"` -} - -// CreateOpts is the struct responsible for creating a security group. -type CreateOpts GroupOpts - -// CreateOptsBuilder builds the create options into a serializable format. -type CreateOptsBuilder interface { - ToSecGroupCreateMap() (map[string]interface{}, error) -} - -var ( - errName = errors.New("Name is a required field") - errDesc = errors.New("Description is a required field") -) - -// ToSecGroupCreateMap builds the create options into a serializable format. -func (opts CreateOpts) ToSecGroupCreateMap() (map[string]interface{}, error) { - sg := make(map[string]interface{}) - - if opts.Name == "" { - return sg, errName - } - if opts.Description == "" { - return sg, errDesc - } - - sg["name"] = opts.Name - sg["description"] = opts.Description - - return map[string]interface{}{"security_group": sg}, nil -} - -// Create will create a new security group. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var result CreateResult - - reqBody, err := opts.ToSecGroupCreateMap() - if err != nil { - result.Err = err - return result - } - - _, result.Err = client.Post(rootURL(client), reqBody, &result.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return result -} - -// UpdateOpts is the struct responsible for updating an existing security group. -type UpdateOpts GroupOpts - -// UpdateOptsBuilder builds the update options into a serializable format. -type UpdateOptsBuilder interface { - ToSecGroupUpdateMap() (map[string]interface{}, error) -} - -// ToSecGroupUpdateMap builds the update options into a serializable format. -func (opts UpdateOpts) ToSecGroupUpdateMap() (map[string]interface{}, error) { - sg := make(map[string]interface{}) - - if opts.Name == "" { - return sg, errName - } - if opts.Description == "" { - return sg, errDesc - } - - sg["name"] = opts.Name - sg["description"] = opts.Description - - return map[string]interface{}{"security_group": sg}, nil -} - -// Update will modify the mutable properties of a security group, notably its -// name and description. -func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult { - var result UpdateResult - - reqBody, err := opts.ToSecGroupUpdateMap() - if err != nil { - result.Err = err - return result - } - - _, result.Err = client.Put(resourceURL(client, id), reqBody, &result.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return result -} - -// Get will return details for a particular security group. -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 security group 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 -} - -// CreateRuleOpts represents the configuration for adding a new rule to an -// existing security group. -type CreateRuleOpts struct { - // Required - the ID of the group that this rule will be added to. - ParentGroupID string `json:"parent_group_id"` - - // 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"` - - // ONLY required if CIDR is blank. This value represents the ID of a group - // that forwards traffic to the parent group. So, instead of accepting - // network traffic from an entire IP range, you can instead refine the - // inbound source by an existing security group. - FromGroupID string `json:"group_id,omitempty"` -} - -// CreateRuleOptsBuilder builds the create rule options into a serializable format. -type CreateRuleOptsBuilder interface { - ToRuleCreateMap() (map[string]interface{}, error) -} - -// ToRuleCreateMap builds the create rule options into a serializable format. -func (opts CreateRuleOpts) ToRuleCreateMap() (map[string]interface{}, error) { - rule := make(map[string]interface{}) - - if opts.ParentGroupID == "" { - return rule, errors.New("A ParentGroupID must be set") - } - if opts.FromPort == 0 && strings.ToUpper(opts.IPProtocol) != "ICMP" { - return rule, errors.New("A FromPort must be set") - } - if opts.ToPort == 0 && strings.ToUpper(opts.IPProtocol) != "ICMP" { - return rule, errors.New("A ToPort must be set") - } - if opts.IPProtocol == "" { - return rule, errors.New("A IPProtocol must be set") - } - if opts.CIDR == "" && opts.FromGroupID == "" { - return rule, errors.New("A CIDR or FromGroupID must be set") - } - - rule["parent_group_id"] = opts.ParentGroupID - rule["from_port"] = opts.FromPort - rule["to_port"] = opts.ToPort - rule["ip_protocol"] = opts.IPProtocol - - if opts.CIDR != "" { - rule["cidr"] = opts.CIDR - } - if opts.FromGroupID != "" { - rule["group_id"] = opts.FromGroupID - } - - return map[string]interface{}{"security_group_rule": rule}, nil -} - -// CreateRule will add a new rule to an existing security group (whose ID is -// specified in CreateRuleOpts). You have the option of controlling inbound -// traffic from either an IP range (CIDR) or from another security group. -func CreateRule(client *gophercloud.ServiceClient, opts CreateRuleOptsBuilder) CreateRuleResult { - var result CreateRuleResult - - reqBody, err := opts.ToRuleCreateMap() - if err != nil { - result.Err = err - return result - } - - _, result.Err = client.Post(rootRuleURL(client), reqBody, &result.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return result -} - -// DeleteRule will permanently delete a rule from a security group. -func DeleteRule(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult { - var result gophercloud.ErrResult - _, result.Err = client.Delete(resourceRuleURL(client, id), nil) - return result -} - -func actionMap(prefix, groupName string) map[string]map[string]string { - return map[string]map[string]string{ - prefix + "SecurityGroup": map[string]string{"name": groupName}, - } -} - -// AddServerToGroup will associate a server and a security group, enforcing the -// rules of the group on the server. -func AddServerToGroup(client *gophercloud.ServiceClient, serverID, groupName string) gophercloud.ErrResult { - var result gophercloud.ErrResult - _, result.Err = client.Post(serverActionURL(client, serverID), actionMap("add", groupName), &result.Body, nil) - return result -} - -// RemoveServerFromGroup will disassociate a server from a security group. -func RemoveServerFromGroup(client *gophercloud.ServiceClient, serverID, groupName string) gophercloud.ErrResult { - var result gophercloud.ErrResult - _, result.Err = client.Post(serverActionURL(client, serverID), actionMap("remove", groupName), &result.Body, nil) - return result -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/results.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/results.go deleted file mode 100644 index 478c5dc0973..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/results.go +++ /dev/null @@ -1,147 +0,0 @@ -package secgroups - -import ( - "github.com/mitchellh/mapstructure" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// SecurityGroup represents a security group. -type SecurityGroup struct { - // The unique ID of the group. If Neutron is installed, this ID will be - // represented as a string UUID; if Neutron is not installed, it will be a - // numeric ID. For the sake of consistency, we always cast it to a string. - ID string - - // The human-readable name of the group, which needs to be unique. - Name string - - // The human-readable description of the group. - Description string - - // The rules which determine how this security group operates. - Rules []Rule - - // The ID of the tenant to which this security group belongs. - TenantID string `mapstructure:"tenant_id"` -} - -// Rule represents a security group rule, a policy which determines how a -// security group operates and what inbound traffic it allows in. -type Rule struct { - // The unique ID. If Neutron is installed, this ID will be - // represented as a string UUID; if Neutron is not installed, it will be a - // numeric ID. For the sake of consistency, we always cast it to a string. - ID string - - // The lower bound of the port range which this security group should open up - FromPort int `mapstructure:"from_port"` - - // The upper bound of the port range which this security group should open up - ToPort int `mapstructure:"to_port"` - - // The IP protocol (e.g. TCP) which the security group accepts - IPProtocol string `mapstructure:"ip_protocol"` - - // The CIDR IP range whose traffic can be received - IPRange IPRange `mapstructure:"ip_range"` - - // The security group ID to which this rule belongs - ParentGroupID string `mapstructure:"parent_group_id"` - - // Not documented. - Group Group -} - -// IPRange represents the IP range whose traffic will be accepted by the -// security group. -type IPRange struct { - CIDR string -} - -// Group represents a group. -type Group struct { - TenantID string `mapstructure:"tenant_id"` - Name string -} - -// SecurityGroupPage is a single page of a SecurityGroup collection. -type SecurityGroupPage struct { - pagination.SinglePageBase -} - -// IsEmpty determines whether or not a page of Security Groups contains any results. -func (page SecurityGroupPage) IsEmpty() (bool, error) { - users, err := ExtractSecurityGroups(page) - if err != nil { - return false, err - } - return len(users) == 0, nil -} - -// ExtractSecurityGroups returns a slice of SecurityGroups contained in a single page of results. -func ExtractSecurityGroups(page pagination.Page) ([]SecurityGroup, error) { - casted := page.(SecurityGroupPage).Body - var response struct { - SecurityGroups []SecurityGroup `mapstructure:"security_groups"` - } - - err := mapstructure.WeakDecode(casted, &response) - - return response.SecurityGroups, 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 -} - -// UpdateResult represents the result of an update operation. -type UpdateResult struct { - commonResult -} - -// Extract will extract a SecurityGroup struct from most responses. -func (r commonResult) Extract() (*SecurityGroup, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - SecurityGroup SecurityGroup `mapstructure:"security_group"` - } - - err := mapstructure.WeakDecode(r.Body, &response) - - return &response.SecurityGroup, err -} - -// CreateRuleResult represents the result when adding rules to a security group. -type CreateRuleResult struct { - gophercloud.Result -} - -// Extract will extract a Rule struct from a CreateRuleResult. -func (r CreateRuleResult) Extract() (*Rule, error) { - if r.Err != nil { - return nil, r.Err - } - - var response struct { - Rule Rule `mapstructure:"security_group_rule"` - } - - err := mapstructure.WeakDecode(r.Body, &response) - - return &response.Rule, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/urls.go deleted file mode 100644 index dc53fbfac63..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups/urls.go +++ /dev/null @@ -1,32 +0,0 @@ -package secgroups - -import "github.com/rackspace/gophercloud" - -const ( - secgrouppath = "os-security-groups" - rulepath = "os-security-group-rules" -) - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(secgrouppath, id) -} - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(secgrouppath) -} - -func listByServerURL(c *gophercloud.ServiceClient, serverID string) string { - return c.ServiceURL("servers", serverID, secgrouppath) -} - -func rootRuleURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rulepath) -} - -func resourceRuleURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rulepath, id) -} - -func serverActionURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("servers", id, "action") -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/doc.go deleted file mode 100644 index 1e5ed568daa..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package servergroups provides the ability to manage server groups -package servergroups diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/fixtures.go deleted file mode 100644 index 133fd85ced1..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/fixtures.go +++ /dev/null @@ -1,161 +0,0 @@ -// +build fixtures - -package servergroups - -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 = ` -{ - "server_groups": [ - { - "id": "616fb98f-46ca-475e-917e-2563e5a8cd19", - "name": "test", - "policies": [ - "anti-affinity" - ], - "members": [], - "metadata": {} - }, - { - "id": "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - "name": "test2", - "policies": [ - "affinity" - ], - "members": [], - "metadata": {} - } - ] -} -` - -// GetOutput is a sample response to a Get call. -const GetOutput = ` -{ - "server_group": { - "id": "616fb98f-46ca-475e-917e-2563e5a8cd19", - "name": "test", - "policies": [ - "anti-affinity" - ], - "members": [], - "metadata": {} - } -} -` - -// CreateOutput is a sample response to a Post call -const CreateOutput = ` -{ - "server_group": { - "id": "616fb98f-46ca-475e-917e-2563e5a8cd19", - "name": "test", - "policies": [ - "anti-affinity" - ], - "members": [], - "metadata": {} - } -} -` - -// FirstServerGroup is the first result in ListOutput. -var FirstServerGroup = ServerGroup{ - ID: "616fb98f-46ca-475e-917e-2563e5a8cd19", - Name: "test", - Policies: []string{ - "anti-affinity", - }, - Members: []string{}, - Metadata: map[string]interface{}{}, -} - -// SecondServerGroup is the second result in ListOutput. -var SecondServerGroup = ServerGroup{ - ID: "4d8c3732-a248-40ed-bebc-539a6ffd25c0", - Name: "test2", - Policies: []string{ - "affinity", - }, - Members: []string{}, - Metadata: map[string]interface{}{}, -} - -// ExpectedServerGroupSlice is the slice of results that should be parsed -// from ListOutput, in the expected order. -var ExpectedServerGroupSlice = []ServerGroup{FirstServerGroup, SecondServerGroup} - -// CreatedServerGroup is the parsed result from CreateOutput. -var CreatedServerGroup = ServerGroup{ - ID: "616fb98f-46ca-475e-917e-2563e5a8cd19", - Name: "test", - Policies: []string{ - "anti-affinity", - }, - Members: []string{}, - Metadata: map[string]interface{}{}, -} - -// HandleListSuccessfully configures the test server to respond to a List request. -func HandleListSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-server-groups", 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 server group -func HandleGetSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-server-groups/4d8c3732-a248-40ed-bebc-539a6ffd25c0", 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 server group -func HandleCreateSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-server-groups", 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, ` -{ - "server_group": { - "name": "test", - "policies": [ - "anti-affinity" - ] - } -} -`) - - 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 server group -func HandleDeleteSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/os-server-groups/616fb98f-46ca-475e-917e-2563e5a8cd19", 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/compute/v2/extensions/servergroups/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/requests.go deleted file mode 100644 index 1597b43eb22..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/requests.go +++ /dev/null @@ -1,77 +0,0 @@ -package servergroups - -import ( - "errors" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// List returns a Pager that allows you to iterate over a collection of ServerGroups. -func List(client *gophercloud.ServiceClient) pagination.Pager { - return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page { - return ServerGroupsPage{pagination.SinglePageBase(r)} - }) -} - -// CreateOptsBuilder describes struct types that can be accepted by the Create call. Notably, the -// CreateOpts struct in this package does. -type CreateOptsBuilder interface { - ToServerGroupCreateMap() (map[string]interface{}, error) -} - -// CreateOpts specifies a Server Group allocation request -type CreateOpts struct { - // Name is the name of the server group - Name string - - // Policies are the server group policies - Policies []string -} - -// ToServerGroupCreateMap constructs a request body from CreateOpts. -func (opts CreateOpts) ToServerGroupCreateMap() (map[string]interface{}, error) { - if opts.Name == "" { - return nil, errors.New("Missing field required for server group creation: Name") - } - - if len(opts.Policies) < 1 { - return nil, errors.New("Missing field required for server group creation: Policies") - } - - serverGroup := make(map[string]interface{}) - serverGroup["name"] = opts.Name - serverGroup["policies"] = opts.Policies - - return map[string]interface{}{"server_group": serverGroup}, nil -} - -// Create requests the creation of a new Server Group -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToServerGroupCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = client.Post(createURL(client), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// Get returns data about a previously created ServerGroup. -func Get(client *gophercloud.ServiceClient, id string) GetResult { - var res GetResult - _, res.Err = client.Get(getURL(client, id), &res.Body, nil) - return res -} - -// Delete requests the deletion of a previously allocated ServerGroup. -func Delete(client *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - _, res.Err = client.Delete(deleteURL(client, id), nil) - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/results.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/results.go deleted file mode 100644 index d74ee5dbb00..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/results.go +++ /dev/null @@ -1,87 +0,0 @@ -package servergroups - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// A ServerGroup creates a policy for instance placement in the cloud -type ServerGroup struct { - // ID is the unique ID of the Server Group. - ID string `mapstructure:"id"` - - // Name is the common name of the server group. - Name string `mapstructure:"name"` - - // Polices are the group policies. - Policies []string `mapstructure:"policies"` - - // Members are the members of the server group. - Members []string `mapstructure:"members"` - - // Metadata includes a list of all user-specified key-value pairs attached to the Server Group. - Metadata map[string]interface{} -} - -// ServerGroupsPage stores a single, only page of ServerGroups -// results from a List call. -type ServerGroupsPage struct { - pagination.SinglePageBase -} - -// IsEmpty determines whether or not a ServerGroupsPage is empty. -func (page ServerGroupsPage) IsEmpty() (bool, error) { - va, err := ExtractServerGroups(page) - return len(va) == 0, err -} - -// ExtractServerGroups interprets a page of results as a slice of -// ServerGroups. -func ExtractServerGroups(page pagination.Page) ([]ServerGroup, error) { - casted := page.(ServerGroupsPage).Body - var response struct { - ServerGroups []ServerGroup `mapstructure:"server_groups"` - } - - err := mapstructure.WeakDecode(casted, &response) - - return response.ServerGroups, err -} - -type ServerGroupResult struct { - gophercloud.Result -} - -// Extract is a method that attempts to interpret any Server Group resource -// response as a ServerGroup struct. -func (r ServerGroupResult) Extract() (*ServerGroup, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - ServerGroup *ServerGroup `json:"server_group" mapstructure:"server_group"` - } - - err := mapstructure.WeakDecode(r.Body, &res) - return res.ServerGroup, err -} - -// CreateResult is the response from a Create operation. Call its Extract method to interpret it -// as a ServerGroup. -type CreateResult struct { - ServerGroupResult -} - -// GetResult is the response from a Get operation. Call its Extract method to interpret it -// as a ServerGroup. -type GetResult struct { - ServerGroupResult -} - -// DeleteResult is the response from a Delete operation. Call its Extract method to determine if -// the call succeeded or failed. -type DeleteResult struct { - gophercloud.ErrResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/urls.go deleted file mode 100644 index 074a16c67f2..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/servergroups/urls.go +++ /dev/null @@ -1,25 +0,0 @@ -package servergroups - -import "github.com/rackspace/gophercloud" - -const resourcePath = "os-server-groups" - -func resourceURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(resourcePath) -} - -func listURL(c *gophercloud.ServiceClient) string { - return resourceURL(c) -} - -func createURL(c *gophercloud.ServiceClient) string { - return resourceURL(c) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(resourcePath, id) -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return getURL(c, 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 d2729f87437..00000000000 --- 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 670828a986d..00000000000 --- 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 0e090e69f26..00000000000 --- 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/tenantnetworks/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/doc.go deleted file mode 100644 index 65c46ff5078..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package tenantnetworks provides the ability for tenants to see information about the networks they have access to -package tenantnetworks diff --git a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/fixtures.go deleted file mode 100644 index 0cfa72ab061..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/fixtures.go +++ /dev/null @@ -1,84 +0,0 @@ -// +build fixtures - -package tenantnetworks - -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": [ - { - "cidr": "10.0.0.0/29", - "id": "20c8acc0-f747-4d71-a389-46d078ebf047", - "label": "mynet_0" - }, - { - "cidr": "10.0.0.10/29", - "id": "20c8acc0-f747-4d71-a389-46d078ebf000", - "label": "mynet_1" - } - ] -} -` - -// GetOutput is a sample response to a Get call. -const GetOutput = ` -{ - "network": { - "cidr": "10.0.0.10/29", - "id": "20c8acc0-f747-4d71-a389-46d078ebf000", - "label": "mynet_1" - } -} -` - -// FirstNetwork is the first result in ListOutput. -var nilTime time.Time -var FirstNetwork = Network{ - CIDR: "10.0.0.0/29", - ID: "20c8acc0-f747-4d71-a389-46d078ebf047", - Name: "mynet_0", -} - -// SecondNetwork is the second result in ListOutput. -var SecondNetwork = Network{ - CIDR: "10.0.0.10/29", - ID: "20c8acc0-f747-4d71-a389-46d078ebf000", - Name: "mynet_1", -} - -// 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-tenant-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-tenant-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/tenantnetworks/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/requests.go deleted file mode 100644 index 3ec13d384b0..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/requests.go +++ /dev/null @@ -1,22 +0,0 @@ -package tenantnetworks - -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/tenantnetworks/results.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/results.go deleted file mode 100644 index 805009247a9..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/results.go +++ /dev/null @@ -1,68 +0,0 @@ -package tenantnetworks - -import ( - "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 { - // CIDR is the IPv4 subnet. - CIDR string `mapstructure:"cidr"` - - // ID is the UUID of the network. - ID string `mapstructure:"id"` - - // Name is the common name that the network has. - Name string `mapstructure:"label"` -} - -// 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) { - networks := page.(NetworkPage).Body - var res struct { - Networks []Network `mapstructure:"networks"` - } - - err := mapstructure.WeakDecode(networks, &res) - - 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"` - } - - err := mapstructure.Decode(r.Body, &res) - 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/tenantnetworks/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/urls.go deleted file mode 100644 index 2401a5d038f..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/tenantnetworks/urls.go +++ /dev/null @@ -1,17 +0,0 @@ -package tenantnetworks - -import "github.com/rackspace/gophercloud" - -const resourcePath = "os-tenant-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/volumeattach/testing/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/compute/v2/extensions/volumeattach/testing/doc.go deleted file mode 100644 index 183391a6291..00000000000 --- 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 c469bfbc859..00000000000 --- 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 45b9cfb4e88..00000000000 --- 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 ae654161547..00000000000 --- 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 83c710206ab..00000000000 --- 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 d0d1d6e99d1..00000000000 --- 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 abea9615899..00000000000 --- 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 15275fe5d7d..00000000000 --- 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 3e677211b52..00000000000 --- 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 f1eb5d9aeec..00000000000 --- 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 7d4b6aeb285..00000000000 --- 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 027ca584786..00000000000 --- 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 ae14026b525..00000000000 --- 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 fd767cd3b28..00000000000 --- 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 9e147ab2dbf..00000000000 --- 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 a86a3cc602b..00000000000 --- 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 c4d52480e93..00000000000 --- 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 4d281d562ff..00000000000 --- 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 f0016bcb269..00000000000 --- 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 fa34446b80a..00000000000 --- 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 2cee010aaee..00000000000 --- 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 80da11f9b36..00000000000 --- 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 dc5c90f9551..00000000000 --- 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 af7b185a607..00000000000 --- 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 f4a63b81448..00000000000 --- 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 95aed166b59..00000000000 --- 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 28c0bec3df5..00000000000 --- 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 cf07832f346..00000000000 --- 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 516b335e061..00000000000 --- 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 7533fc494be..00000000000 --- 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 217ddd8daf8..00000000000 --- 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 2a3cacdaf5e..00000000000 --- 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 89541787167..00000000000 --- 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 8256f0fe8e6..00000000000 --- 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 9a333140b2b..00000000000 --- 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 ebb3aa530b8..00000000000 --- 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 61b31551dd9..00000000000 --- 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 fd6e80ea6f1..00000000000 --- 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 791e4e391da..00000000000 --- 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 96cb7d24a13..00000000000 --- 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 82abcb9fccb..00000000000 --- 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 8941868dd2b..00000000000 --- 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 88be45ecc01..00000000000 --- 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 f531d5d023a..00000000000 --- 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 7ec4385d743..00000000000 --- 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 85163949a83..00000000000 --- 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 854957ff98d..00000000000 --- 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 99a495d594e..00000000000 --- 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 128112295a2..00000000000 --- 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 547d7b102a5..00000000000 --- 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 bdbc674d659..00000000000 --- 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 d95c1e52f6f..00000000000 --- 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 d25abd25d77..00000000000 --- 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 b009340d096..00000000000 --- 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 fa56411856b..00000000000 --- 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 3ee924f3ee6..00000000000 --- 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 1d0d1412806..00000000000 --- 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 85443a48a09..00000000000 --- 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 0208ee20ecb..00000000000 --- 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 76bdb14f750..00000000000 --- 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 9fb6de14110..00000000000 --- 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 97159341ffb..00000000000 --- 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 58aa2b61f8b..00000000000 --- 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 41603510d62..00000000000 --- 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 d08e1fda977..00000000000 --- 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 dad3a844f75..00000000000 --- 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 097ae37f243..00000000000 --- 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 54dbf4bb69e..00000000000 --- 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 3ec450a7b3d..00000000000 --- 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/fwaas/firewalls/errors.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/errors.go deleted file mode 100644 index dd92bb20dbe..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/errors.go +++ /dev/null @@ -1,11 +0,0 @@ -package firewalls - -import "fmt" - -func err(str string) error { - return fmt.Errorf("%s", str) -} - -var ( - errPolicyRequired = err("A policy ID is required") -) diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/requests.go deleted file mode 100644 index 12d587f389b..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/requests.go +++ /dev/null @@ -1,216 +0,0 @@ -package firewalls - -import ( - "github.com/rackspace/gophercloud" - "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 - -// Shared gives users a solid type to work with for create and update -// operations. It is recommended that users use the `Yes` and `No` enums. -type Shared *bool - -// Convenience vars for AdminStateUp and Shared values. -var ( - iTrue = true - iFalse = false - Up AdminState = &iTrue - Down AdminState = &iFalse - Yes Shared = &iTrue - No Shared = &iFalse -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToFirewallListQuery() (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 firewall attributes you want to see returned. SortKey allows you to sort -// by a particular firewall attribute. SortDir sets the direction, and is either -// `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - TenantID string `q:"tenant_id"` - Name string `q:"name"` - Description string `q:"description"` - AdminStateUp bool `q:"admin_state_up"` - Shared bool `q:"shared"` - PolicyID string `q:"firewall_policy_id"` - ID string `q:"id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToFirewallListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToFirewallListQuery() (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 -// firewalls. It accepts a ListOpts struct, which allows you to filter -// and sort the returned collection for greater efficiency. -// -// Default policy settings return only those firewalls that are owned by the -// tenant who submits the request, unless an admin user submits the request. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := rootURL(c) - - if opts != nil { - query, err := opts.ToFirewallListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return FirewallPage{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 { - ToFirewallCreateMap() (map[string]interface{}, error) -} - -// CreateOpts contains all the values needed to create a new firewall. -type CreateOpts struct { - // Only required if the caller has an admin role and wants to create a firewall - // for another tenant. - TenantID string - Name string - Description string - AdminStateUp *bool - Shared *bool - PolicyID string -} - -// ToFirewallCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToFirewallCreateMap() (map[string]interface{}, error) { - if opts.PolicyID == "" { - return nil, errPolicyRequired - } - - f := make(map[string]interface{}) - - if opts.TenantID != "" { - f["tenant_id"] = opts.TenantID - } - if opts.Name != "" { - f["name"] = opts.Name - } - if opts.Description != "" { - f["description"] = opts.Description - } - if opts.Shared != nil { - f["shared"] = *opts.Shared - } - if opts.AdminStateUp != nil { - f["admin_state_up"] = *opts.AdminStateUp - } - if opts.PolicyID != "" { - f["firewall_policy_id"] = opts.PolicyID - } - - return map[string]interface{}{"firewall": f}, nil -} - -// Create accepts a CreateOpts struct and uses the values to create a new firewall -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToFirewallCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(rootURL(c), reqBody, &res.Body, nil) - return res -} - -// Get retrieves a particular firewall 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 -} - -// 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 { - ToFirewallUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts contains the values used when updating a firewall. -type UpdateOpts struct { - // Name of the firewall. - Name string - Description string - AdminStateUp *bool - Shared *bool - PolicyID string -} - -// ToFirewallUpdateMap casts a CreateOpts struct to a map. -func (opts UpdateOpts) ToFirewallUpdateMap() (map[string]interface{}, error) { - f := make(map[string]interface{}) - - if opts.Name != "" { - f["name"] = opts.Name - } - if opts.Description != "" { - f["description"] = opts.Description - } - if opts.Shared != nil { - f["shared"] = *opts.Shared - } - if opts.AdminStateUp != nil { - f["admin_state_up"] = *opts.AdminStateUp - } - if opts.PolicyID != "" { - f["firewall_policy_id"] = opts.PolicyID - } - - return map[string]interface{}{"firewall": f}, nil -} - -// Update allows firewalls to be updated. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToFirewallUpdateMap() - if err != nil { - res.Err = err - return res - } - - // Send request to API - _, res.Err = c.Put(resourceURL(c, id), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// Delete will permanently delete a particular firewall 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/fwaas/firewalls/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/results.go deleted file mode 100644 index a8c76eef232..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/results.go +++ /dev/null @@ -1,101 +0,0 @@ -package firewalls - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -type Firewall struct { - ID string `json:"id" mapstructure:"id"` - Name string `json:"name" mapstructure:"name"` - Description string `json:"description" mapstructure:"description"` - AdminStateUp bool `json:"admin_state_up" mapstructure:"admin_state_up"` - Status string `json:"status" mapstructure:"status"` - PolicyID string `json:"firewall_policy_id" mapstructure:"firewall_policy_id"` - TenantID string `json:"tenant_id" mapstructure:"tenant_id"` -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a firewall. -func (r commonResult) Extract() (*Firewall, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Firewall *Firewall `json:"firewall"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.Firewall, err -} - -// FirewallPage is the page returned by a pager when traversing over a -// collection of firewalls. -type FirewallPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of firewalls 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 FirewallPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"firewalls_links"` - } - - var r resp - err := mapstructure.Decode(p.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// IsEmpty checks whether a FirewallPage struct is empty. -func (p FirewallPage) IsEmpty() (bool, error) { - is, err := ExtractFirewalls(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractFirewalls accepts a Page struct, specifically a RouterPage struct, -// and extracts the elements into a slice of Router structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractFirewalls(page pagination.Page) ([]Firewall, error) { - var resp struct { - Firewalls []Firewall `mapstructure:"firewalls" json:"firewalls"` - } - - err := mapstructure.Decode(page.(FirewallPage).Body, &resp) - - return resp.Firewalls, err -} - -// 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 { - gophercloud.ErrResult -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/urls.go deleted file mode 100644 index 4dde53005a2..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls/urls.go +++ /dev/null @@ -1,16 +0,0 @@ -package firewalls - -import "github.com/rackspace/gophercloud" - -const ( - rootPath = "fw" - resourcePath = "firewalls" -) - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath, resourcePath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies/requests.go deleted file mode 100644 index fe07d9abb14..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies/requests.go +++ /dev/null @@ -1,243 +0,0 @@ -package policies - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Binary gives users a solid type to work with for create and update -// operations. It is recommended that users use the `Yes` and `No` enums -type Binary *bool - -// Convenience vars for Audited and Shared values. -var ( - iTrue = true - iFalse = false - Yes Binary = &iTrue - No Binary = &iFalse -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToPolicyListQuery() (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 firewall policy attributes you want to see returned. SortKey allows you -// to sort by a particular firewall policy attribute. SortDir sets the direction, -// and is either `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - TenantID string `q:"tenant_id"` - Name string `q:"name"` - Description string `q:"description"` - Shared bool `q:"shared"` - Audited bool `q:"audited"` - ID string `q:"id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToPolicyListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToPolicyListQuery() (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 -// firewall policies. It accepts a ListOpts struct, which allows you to filter -// and sort the returned collection for greater efficiency. -// -// Default policy settings return only those firewall policies that are owned by the -// tenant who submits the request, unless an admin user submits the request. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := rootURL(c) - - if opts != nil { - query, err := opts.ToPolicyListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return PolicyPage{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 { - ToPolicyCreateMap() (map[string]interface{}, error) -} - -// CreateOpts contains all the values needed to create a new firewall policy. -type CreateOpts struct { - // Only required if the caller has an admin role and wants to create a firewall policy - // for another tenant. - TenantID string - Name string - Description string - Shared *bool - Audited *bool - Rules []string -} - -// ToPolicyCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToPolicyCreateMap() (map[string]interface{}, error) { - p := make(map[string]interface{}) - - if opts.TenantID != "" { - p["tenant_id"] = opts.TenantID - } - if opts.Name != "" { - p["name"] = opts.Name - } - if opts.Description != "" { - p["description"] = opts.Description - } - if opts.Shared != nil { - p["shared"] = *opts.Shared - } - if opts.Audited != nil { - p["audited"] = *opts.Audited - } - if opts.Rules != nil { - p["firewall_rules"] = opts.Rules - } - - return map[string]interface{}{"firewall_policy": p}, nil -} - -// Create accepts a CreateOpts struct and uses the values to create a new firewall policy -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToPolicyCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(rootURL(c), reqBody, &res.Body, nil) - return res -} - -// Get retrieves a particular firewall policy 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 -} - -// 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 { - ToPolicyUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts contains the values used when updating a firewall policy. -type UpdateOpts struct { - // Name of the firewall policy. - Name string - Description string - Shared *bool - Audited *bool - Rules []string -} - -// ToPolicyUpdateMap casts a CreateOpts struct to a map. -func (opts UpdateOpts) ToPolicyUpdateMap() (map[string]interface{}, error) { - p := make(map[string]interface{}) - - if opts.Name != "" { - p["name"] = opts.Name - } - if opts.Description != "" { - p["description"] = opts.Description - } - if opts.Shared != nil { - p["shared"] = *opts.Shared - } - if opts.Audited != nil { - p["audited"] = *opts.Audited - } - if opts.Rules != nil { - p["firewall_rules"] = opts.Rules - } - - return map[string]interface{}{"firewall_policy": p}, nil -} - -// Update allows firewall policies to be updated. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToPolicyUpdateMap() - if err != nil { - res.Err = err - return res - } - - // Send request to API - _, res.Err = c.Put(resourceURL(c, id), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res -} - -// Delete will permanently delete a particular firewall policy 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 -} - -func InsertRule(c *gophercloud.ServiceClient, policyID, ruleID, beforeID, afterID string) error { - type request struct { - RuleId string `json:"firewall_rule_id"` - Before string `json:"insert_before,omitempty"` - After string `json:"insert_after,omitempty"` - } - - reqBody := request{ - RuleId: ruleID, - Before: beforeID, - After: afterID, - } - - // Send request to API - var res commonResult - _, res.Err = c.Put(insertURL(c, policyID), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res.Err -} - -func RemoveRule(c *gophercloud.ServiceClient, policyID, ruleID string) error { - type request struct { - RuleId string `json:"firewall_rule_id"` - } - - reqBody := request{ - RuleId: ruleID, - } - - // Send request to API - var res commonResult - _, res.Err = c.Put(removeURL(c, policyID), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return res.Err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies/results.go deleted file mode 100644 index a9a0c358d57..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies/results.go +++ /dev/null @@ -1,101 +0,0 @@ -package policies - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -type Policy struct { - ID string `json:"id" mapstructure:"id"` - Name string `json:"name" mapstructure:"name"` - Description string `json:"description" mapstructure:"description"` - TenantID string `json:"tenant_id" mapstructure:"tenant_id"` - Audited bool `json:"audited" mapstructure:"audited"` - Shared bool `json:"shared" mapstructure:"shared"` - Rules []string `json:"firewall_rules,omitempty" mapstructure:"firewall_rules"` -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a firewall policy. -func (r commonResult) Extract() (*Policy, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Policy *Policy `json:"firewall_policy" mapstructure:"firewall_policy"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.Policy, err -} - -// PolicyPage is the page returned by a pager when traversing over a -// collection of firewall policies. -type PolicyPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of firewall policies 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 PolicyPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"firewall_policies_links"` - } - - var r resp - err := mapstructure.Decode(p.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// IsEmpty checks whether a PolicyPage struct is empty. -func (p PolicyPage) IsEmpty() (bool, error) { - is, err := ExtractPolicies(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractPolicies accepts a Page struct, specifically a RouterPage struct, -// and extracts the elements into a slice of Router structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractPolicies(page pagination.Page) ([]Policy, error) { - var resp struct { - Policies []Policy `mapstructure:"firewall_policies" json:"firewall_policies"` - } - - err := mapstructure.Decode(page.(PolicyPage).Body, &resp) - - return resp.Policies, err -} - -// 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 { - gophercloud.ErrResult -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies/urls.go deleted file mode 100644 index 27ea9ae6143..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/policies/urls.go +++ /dev/null @@ -1,26 +0,0 @@ -package policies - -import "github.com/rackspace/gophercloud" - -const ( - rootPath = "fw" - resourcePath = "firewall_policies" - insertPath = "insert_rule" - removePath = "remove_rule" -) - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath, resourcePath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id) -} - -func insertURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id, insertPath) -} - -func removeURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id, removePath) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/errors.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/errors.go deleted file mode 100644 index 0b29d39fd9e..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/errors.go +++ /dev/null @@ -1,12 +0,0 @@ -package rules - -import "fmt" - -func err(str string) error { - return fmt.Errorf("%s", str) -} - -var ( - errProtocolRequired = err("A protocol is required (tcp, udp, icmp or any)") - errActionRequired = err("An action is required (allow or deny)") -) diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/requests.go deleted file mode 100644 index 57a0e8baffc..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/requests.go +++ /dev/null @@ -1,285 +0,0 @@ -package rules - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Binary gives users a solid type to work with for create and update -// operations. It is recommended that users use the `Yes` and `No` enums -type Binary *bool - -// Convenience vars for Enabled and Shared values. -var ( - iTrue = true - iFalse = false - Yes Binary = &iTrue - No Binary = &iFalse -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToRuleListQuery() (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 Firewall rule attributes you want to see returned. SortKey allows you to -// sort by a particular firewall rule attribute. SortDir sets the direction, and is -// either `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - TenantID string `q:"tenant_id"` - Name string `q:"name"` - Description string `q:"description"` - Protocol string `q:"protocol"` - Action string `q:"action"` - IPVersion int `q:"ip_version"` - SourceIPAddress string `q:"source_ip_address"` - DestinationIPAddress string `q:"destination_ip_address"` - SourcePort string `q:"source_port"` - DestinationPort string `q:"destination_port"` - Enabled bool `q:"enabled"` - ID string `q:"id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToRuleListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToRuleListQuery() (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 -// firewall rules. It accepts a ListOpts struct, which allows you to filter -// and sort the returned collection for greater efficiency. -// -// Default policy settings return only those firewall rules that are owned by the -// tenant who submits the request, unless an admin user submits the request. -func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { - url := rootURL(c) - - if opts != nil { - query, err := opts.ToRuleListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return RulePage{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 { - ToRuleCreateMap() (map[string]interface{}, error) -} - -// CreateOpts contains all the values needed to create a new firewall rule. -type CreateOpts struct { - // Mandatory for create - Protocol string - Action string - // Optional - TenantID string - Name string - Description string - IPVersion int - SourceIPAddress string - DestinationIPAddress string - SourcePort string - DestinationPort string - Shared *bool - Enabled *bool -} - -// ToRuleCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToRuleCreateMap() (map[string]interface{}, error) { - if opts.Protocol == "" { - return nil, errProtocolRequired - } - - if opts.Action == "" { - return nil, errActionRequired - } - - r := make(map[string]interface{}) - - r["protocol"] = opts.Protocol - r["action"] = opts.Action - - if opts.TenantID != "" { - r["tenant_id"] = opts.TenantID - } - if opts.Name != "" { - r["name"] = opts.Name - } - if opts.Description != "" { - r["description"] = opts.Description - } - if opts.IPVersion != 0 { - r["ip_version"] = opts.IPVersion - } - if opts.SourceIPAddress != "" { - r["source_ip_address"] = opts.SourceIPAddress - } - if opts.DestinationIPAddress != "" { - r["destination_ip_address"] = opts.DestinationIPAddress - } - if opts.SourcePort != "" { - r["source_port"] = opts.SourcePort - } - if opts.DestinationPort != "" { - r["destination_port"] = opts.DestinationPort - } - if opts.Shared != nil { - r["shared"] = *opts.Shared - } - if opts.Enabled != nil { - r["enabled"] = *opts.Enabled - } - - return map[string]interface{}{"firewall_rule": r}, nil -} - -// Create accepts a CreateOpts struct and uses the values to create a new firewall rule -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToRuleCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(rootURL(c), reqBody, &res.Body, nil) - return res -} - -// Get retrieves a particular firewall 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 -} - -// 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 { - ToRuleUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts contains the values used when updating a firewall rule. -// Optional -type UpdateOpts struct { - Protocol string - Action string - Name string - Description string - IPVersion int - SourceIPAddress *string - DestinationIPAddress *string - SourcePort *string - DestinationPort *string - Shared *bool - Enabled *bool -} - -// ToRuleUpdateMap casts a UpdateOpts struct to a map. -func (opts UpdateOpts) ToRuleUpdateMap() (map[string]interface{}, error) { - r := make(map[string]interface{}) - - if opts.Protocol != "" { - r["protocol"] = opts.Protocol - } - if opts.Action != "" { - r["action"] = opts.Action - } - if opts.Name != "" { - r["name"] = opts.Name - } - if opts.Description != "" { - r["description"] = opts.Description - } - if opts.IPVersion != 0 { - r["ip_version"] = opts.IPVersion - } - if opts.SourceIPAddress != nil { - s := *opts.SourceIPAddress - if s == "" { - r["source_ip_address"] = nil - } else { - r["source_ip_address"] = s - } - } - if opts.DestinationIPAddress != nil { - s := *opts.DestinationIPAddress - if s == "" { - r["destination_ip_address"] = nil - } else { - r["destination_ip_address"] = s - } - } - if opts.SourcePort != nil { - s := *opts.SourcePort - if s == "" { - r["source_port"] = nil - } else { - r["source_port"] = s - } - } - if opts.DestinationPort != nil { - s := *opts.DestinationPort - if s == "" { - r["destination_port"] = nil - } else { - r["destination_port"] = s - } - } - if opts.Shared != nil { - r["shared"] = *opts.Shared - } - if opts.Enabled != nil { - r["enabled"] = *opts.Enabled - } - - return map[string]interface{}{"firewall_rule": r}, nil -} - -// Update allows firewall policies to be updated. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToRuleUpdateMap() - if err != nil { - res.Err = err - return res - } - - // Send request to API - _, res.Err = c.Put(resourceURL(c, id), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return res -} - -// Delete will permanently delete a particular firewall 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/fwaas/rules/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/results.go deleted file mode 100644 index d772024b39f..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/results.go +++ /dev/null @@ -1,110 +0,0 @@ -package rules - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// Rule represents a firewall rule -type Rule struct { - ID string `json:"id" mapstructure:"id"` - Name string `json:"name,omitempty" mapstructure:"name"` - Description string `json:"description,omitempty" mapstructure:"description"` - Protocol string `json:"protocol" mapstructure:"protocol"` - Action string `json:"action" mapstructure:"action"` - IPVersion int `json:"ip_version,omitempty" mapstructure:"ip_version"` - SourceIPAddress string `json:"source_ip_address,omitempty" mapstructure:"source_ip_address"` - DestinationIPAddress string `json:"destination_ip_address,omitempty" mapstructure:"destination_ip_address"` - SourcePort string `json:"source_port,omitempty" mapstructure:"source_port"` - DestinationPort string `json:"destination_port,omitempty" mapstructure:"destination_port"` - Shared bool `json:"shared,omitempty" mapstructure:"shared"` - Enabled bool `json:"enabled,omitempty" mapstructure:"enabled"` - PolicyID string `json:"firewall_policy_id" mapstructure:"firewall_policy_id"` - Position int `json:"position" mapstructure:"position"` - TenantID string `json:"tenant_id" mapstructure:"tenant_id"` -} - -// RulePage is the page returned by a pager when traversing over a -// collection of firewall rules. -type RulePage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of firewall 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 RulePage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"firewall_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 RulePage struct is empty. -func (p RulePage) 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 RouterPage struct, -// and extracts the elements into a slice of Router structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractRules(page pagination.Page) ([]Rule, error) { - var resp struct { - Rules []Rule `mapstructure:"firewall_rules" json:"firewall_rules"` - } - - err := mapstructure.Decode(page.(RulePage).Body, &resp) - - return resp.Rules, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a firewall rule. -func (r commonResult) Extract() (*Rule, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Rule *Rule `json:"firewall_rule" mapstructure:"firewall_rule"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.Rule, err -} - -// 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 { - gophercloud.ErrResult -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - commonResult -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/urls.go deleted file mode 100644 index 20b08791ed2..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/fwaas/rules/urls.go +++ /dev/null @@ -1,16 +0,0 @@ -package rules - -import "github.com/rackspace/gophercloud" - -const ( - rootPath = "fw" - resourcePath = "firewall_rules" -) - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(rootPath, resourcePath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(rootPath, resourcePath, id) -} 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 d533458267e..00000000000 --- 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/layer3/routers/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/requests.go deleted file mode 100644 index 1ffc1369b47..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/requests.go +++ /dev/null @@ -1,237 +0,0 @@ -package routers - -import ( - "errors" - - "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"` - AdminStateUp *bool `q:"admin_state_up"` - Distributed *bool `q:"distributed"` - Status string `q:"status"` - 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 -// routers. It accepts a ListOpts struct, which allows you to filter and sort -// the returned collection for greater efficiency. -// -// Default policy settings return only those routers that are owned by the -// tenant who submits the request, unless an admin user submits the request. -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 RouterPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// CreateOpts contains all the values needed to create a new router. There are -// no required values. -type CreateOpts struct { - Name string - AdminStateUp *bool - Distributed *bool - TenantID string - GatewayInfo *GatewayInfo -} - -// Create accepts a CreateOpts struct and uses the values to create a new -// logical router. When it is created, the router does not have an internal -// interface - it is not associated to any subnet. -// -// You can optionally specify an external gateway for a router using the -// GatewayInfo struct. The external gateway for the router must be plugged into -// an external network (it is external if its `router:external' field is set to -// true). -func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult { - type router struct { - Name *string `json:"name,omitempty"` - AdminStateUp *bool `json:"admin_state_up,omitempty"` - Distributed *bool `json:"distributed,omitempty"` - TenantID *string `json:"tenant_id,omitempty"` - GatewayInfo *GatewayInfo `json:"external_gateway_info,omitempty"` - } - - type request struct { - Router router `json:"router"` - } - - reqBody := request{Router: router{ - Name: gophercloud.MaybeString(opts.Name), - AdminStateUp: opts.AdminStateUp, - Distributed: opts.Distributed, - TenantID: gophercloud.MaybeString(opts.TenantID), - }} - - if opts.GatewayInfo != nil { - reqBody.Router.GatewayInfo = opts.GatewayInfo - } - - var res CreateResult - _, res.Err = c.Post(rootURL(c), reqBody, &res.Body, nil) - return res -} - -// Get retrieves a particular router 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 -} - -// UpdateOpts contains the values used when updating a router. -type UpdateOpts struct { - Name string - AdminStateUp *bool - Distributed *bool - GatewayInfo *GatewayInfo - Routes []Route -} - -// Update allows routers to be updated. You can update the name, administrative -// state, and the external gateway. For more information about how to set the -// external gateway for a router, see Create. This operation does not enable -// the update of router interfaces. To do this, use the AddInterface and -// RemoveInterface functions. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOpts) UpdateResult { - type router struct { - Name *string `json:"name,omitempty"` - AdminStateUp *bool `json:"admin_state_up,omitempty"` - Distributed *bool `json:"distributed,omitempty"` - GatewayInfo *GatewayInfo `json:"external_gateway_info,omitempty"` - Routes []Route `json:"routes"` - } - - type request struct { - Router router `json:"router"` - } - - reqBody := request{Router: router{ - Name: gophercloud.MaybeString(opts.Name), - AdminStateUp: opts.AdminStateUp, - Distributed: opts.Distributed, - }} - - if opts.GatewayInfo != nil { - reqBody.Router.GatewayInfo = opts.GatewayInfo - } - - if opts.Routes != nil { - reqBody.Router.Routes = opts.Routes - } - - // Send request to API - var res UpdateResult - _, res.Err = c.Put(resourceURL(c, id), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return res -} - -// Delete will permanently delete a particular router 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 -} - -var errInvalidInterfaceOpts = errors.New("When adding a router interface you must provide either a subnet ID or a port ID") - -// InterfaceOpts allow you to work with operations that either add or remote -// an internal interface from a router. -type InterfaceOpts struct { - SubnetID string - PortID string -} - -// AddInterface attaches a subnet to an internal router interface. You must -// specify either a SubnetID or PortID in the request body. If you specify both, -// the operation will fail and an error will be returned. -// -// If you specify a SubnetID, the gateway IP address for that particular subnet -// is used to create the router interface. Alternatively, if you specify a -// PortID, the IP address associated with the port is used to create the router -// interface. -// -// If you reference a port that is associated with multiple IP addresses, or -// if the port is associated with zero IP addresses, the operation will fail and -// a 400 Bad Request error will be returned. -// -// If you reference a port already in use, the operation will fail and a 409 -// Conflict error will be returned. -// -// The PortID that is returned after using Extract() on the result of this -// operation can either be the same PortID passed in or, on the other hand, the -// identifier of a new port created by this operation. After the operation -// completes, the device ID of the port is set to the router ID, and the -// device owner attribute is set to `network:router_interface'. -func AddInterface(c *gophercloud.ServiceClient, id string, opts InterfaceOpts) InterfaceResult { - var res InterfaceResult - - // Validate - if (opts.SubnetID == "" && opts.PortID == "") || (opts.SubnetID != "" && opts.PortID != "") { - res.Err = errInvalidInterfaceOpts - return res - } - - type request struct { - SubnetID string `json:"subnet_id,omitempty"` - PortID string `json:"port_id,omitempty"` - } - - body := request{SubnetID: opts.SubnetID, PortID: opts.PortID} - - _, res.Err = c.Put(addInterfaceURL(c, id), body, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return res -} - -// RemoveInterface removes an internal router interface, which detaches a -// subnet from the router. You must specify either a SubnetID or PortID, since -// these values are used to identify the router interface to remove. -// -// Unlike AddInterface, you can also specify both a SubnetID and PortID. If you -// choose to specify both, the subnet ID must correspond to the subnet ID of -// the first IP address on the port specified by the port ID. Otherwise, the -// operation will fail and return a 409 Conflict error. -// -// If the router, subnet or port which are referenced do not exist or are not -// visible to you, the operation will fail and a 404 Not Found error will be -// returned. After this operation completes, the port connecting the router -// with the subnet is removed from the subnet for the network. -func RemoveInterface(c *gophercloud.ServiceClient, id string, opts InterfaceOpts) InterfaceResult { - var res InterfaceResult - - type request struct { - SubnetID string `json:"subnet_id,omitempty"` - PortID string `json:"port_id,omitempty"` - } - - body := request{SubnetID: opts.SubnetID, PortID: opts.PortID} - - _, res.Err = c.Put(removeInterfaceURL(c, id), body, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/results.go deleted file mode 100644 index 45341239831..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/results.go +++ /dev/null @@ -1,171 +0,0 @@ -package routers - -import ( - "github.com/mitchellh/mapstructure" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// GatewayInfo represents the information of an external gateway for any -// particular network router. -type GatewayInfo struct { - NetworkID string `json:"network_id" mapstructure:"network_id"` -} - -type Route struct { - NextHop string `mapstructure:"nexthop" json:"nexthop"` - DestinationCIDR string `mapstructure:"destination" json:"destination"` -} - -// Router represents a Neutron router. A router is a logical entity that -// forwards packets across internal subnets and NATs (network address -// translation) them on external networks through an appropriate gateway. -// -// A router has an interface for each subnet with which it is associated. By -// default, the IP address of such interface is the subnet's gateway IP. Also, -// whenever a router is associated with a subnet, a port for that router -// interface is added to the subnet's network. -type Router struct { - // Indicates whether or not a router is currently operational. - Status string `json:"status" mapstructure:"status"` - - // Information on external gateway for the router. - GatewayInfo GatewayInfo `json:"external_gateway_info" mapstructure:"external_gateway_info"` - - // Administrative state of the router. - AdminStateUp bool `json:"admin_state_up" mapstructure:"admin_state_up"` - - // Whether router is disitrubted or not.. - Distributed bool `json:"distributed" mapstructure:"distributed"` - - // Human readable name for the router. Does not have to be unique. - Name string `json:"name" mapstructure:"name"` - - // Unique identifier for the router. - ID string `json:"id" mapstructure:"id"` - - // Owner of the router. Only admin users can specify a tenant identifier - // other than its own. - TenantID string `json:"tenant_id" mapstructure:"tenant_id"` - - Routes []Route `json:"routes" mapstructure:"routes"` -} - -// RouterPage is the page returned by a pager when traversing over a -// collection of routers. -type RouterPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of routers 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 RouterPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"routers_links"` - } - - var r resp - err := mapstructure.Decode(p.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// IsEmpty checks whether a RouterPage struct is empty. -func (p RouterPage) IsEmpty() (bool, error) { - is, err := ExtractRouters(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractRouters accepts a Page struct, specifically a RouterPage struct, -// and extracts the elements into a slice of Router structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractRouters(page pagination.Page) ([]Router, error) { - var resp struct { - Routers []Router `mapstructure:"routers" json:"routers"` - } - - err := mapstructure.Decode(page.(RouterPage).Body, &resp) - - return resp.Routers, err -} - -type commonResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts a router. -func (r commonResult) Extract() (*Router, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Router *Router `json:"router"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.Router, 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 { - gophercloud.ErrResult -} - -// InterfaceInfo represents information about a particular router interface. As -// mentioned above, in order for a router to forward to a subnet, it needs an -// interface. -type InterfaceInfo struct { - // The ID of the subnet which this interface is associated with. - SubnetID string `json:"subnet_id" mapstructure:"subnet_id"` - - // The ID of the port that is a part of the subnet. - PortID string `json:"port_id" mapstructure:"port_id"` - - // The UUID of the interface. - ID string `json:"id" mapstructure:"id"` - - // Owner of the interface. - TenantID string `json:"tenant_id" mapstructure:"tenant_id"` -} - -// InterfaceResult represents the result of interface operations, such as -// AddInterface() and RemoveInterface(). -type InterfaceResult struct { - gophercloud.Result -} - -// Extract is a function that accepts a result and extracts an information struct. -func (r InterfaceResult) Extract() (*InterfaceInfo, error) { - if r.Err != nil { - return nil, r.Err - } - - var res *InterfaceInfo - err := mapstructure.Decode(r.Body, &res) - - return res, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/urls.go deleted file mode 100644 index bc22c2a8a82..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/routers/urls.go +++ /dev/null @@ -1,21 +0,0 @@ -package routers - -import "github.com/rackspace/gophercloud" - -const resourcePath = "routers" - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL(resourcePath) -} - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(resourcePath, id) -} - -func addInterfaceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(resourcePath, id, "add_router_interface") -} - -func removeInterfaceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL(resourcePath, id, "remove_router_interface") -} 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 bc1fc282f4e..00000000000 --- 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 373da44f84d..00000000000 --- 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 f07d6285dba..00000000000 --- 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 31f744ccd7a..00000000000 --- 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 2712ac1621f..00000000000 --- 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 49db261c22e..00000000000 --- 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 84f7324f090..00000000000 --- 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 e06934a09af..00000000000 --- 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 6e138576893..00000000000 --- 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 8e2b2bb28d2..00000000000 --- 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/networking/v2/networks/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/doc.go deleted file mode 100644 index c87a7ce2708..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Package networks contains functionality for working with Neutron network -// resources. A network is an isolated virtual layer-2 broadcast domain that is -// typically reserved for the tenant who created it (unless you configure the -// network to be shared). Tenants can create multiple networks until the -// thresholds per-tenant quota is reached. -// -// In the v2.0 Networking API, the network is the main entity. Ports and subnets -// are always associated with a network. -package networks diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/errors.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/errors.go deleted file mode 100644 index 83c4a6a8683..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/errors.go +++ /dev/null @@ -1 +0,0 @@ -package networks diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests.go deleted file mode 100644 index 25ab7a8b645..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/requests.go +++ /dev/null @@ -1,226 +0,0 @@ -package networks - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - "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 -) - -type networkOpts struct { - AdminStateUp *bool - Name string - Shared *bool - TenantID string -} - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToNetworkListQuery() (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"` - AdminStateUp *bool `q:"admin_state_up"` - TenantID string `q:"tenant_id"` - Shared *bool `q:"shared"` - ID string `q:"id"` - Marker string `q:"marker"` - Limit int `q:"limit"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToNetworkListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToNetworkListQuery() (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 -// 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 ListOptsBuilder) pagination.Pager { - url := listURL(c) - if opts != nil { - query, err := opts.ToNetworkListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return NetworkPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// 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 networkOpts - -// ToNetworkCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToNetworkCreateMap() (map[string]interface{}, error) { - n := make(map[string]interface{}) - - if opts.AdminStateUp != nil { - n["admin_state_up"] = &opts.AdminStateUp - } - if opts.Name != "" { - n["name"] = opts.Name - } - if opts.Shared != nil { - n["shared"] = &opts.Shared - } - if opts.TenantID != "" { - n["tenant_id"] = opts.TenantID - } - - 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 - } - - _, res.Err = c.Post(createURL(c), reqBody, &res.Body, nil) - return res -} - -// 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 { - ToNetworkUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts is the common options struct used in this package's Update -// operation. -type UpdateOpts networkOpts - -// ToNetworkUpdateMap casts a UpdateOpts struct to a map. -func (opts UpdateOpts) ToNetworkUpdateMap() (map[string]interface{}, error) { - n := make(map[string]interface{}) - - if opts.AdminStateUp != nil { - n["admin_state_up"] = &opts.AdminStateUp - } - if opts.Name != "" { - n["name"] = opts.Name - } - if opts.Shared != nil { - n["shared"] = &opts.Shared - } - - return map[string]interface{}{"network": n}, nil -} - -// 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 UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToNetworkUpdateMap() - if err != nil { - res.Err = err - return res - } - - // Send request to API - _, res.Err = c.Put(updateURL(c, networkID), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201}, - }) - - 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 -} - -// IDFromName is a convenience function that returns a network's ID given its name. -func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { - networkCount := 0 - networkID := "" - if name == "" { - return "", fmt.Errorf("A network name must be provided.") - } - pager := List(client, nil) - pager.EachPage(func(page pagination.Page) (bool, error) { - networkList, err := ExtractNetworks(page) - if err != nil { - return false, err - } - - for _, n := range networkList { - if n.Name == name { - networkCount++ - networkID = n.ID - } - } - return true, nil - }) - - switch networkCount { - case 0: - return "", fmt.Errorf("Unable to find network: %s", name) - case 1: - return networkID, nil - default: - return "", fmt.Errorf("Found %d networks matching %s", networkCount, name) - } -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/results.go deleted file mode 100644 index 3ecedde9ac0..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/results.go +++ /dev/null @@ -1,116 +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 -} - -// UpdateResult represents the result of an update operation. -type UpdateResult 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. - 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"` -} - -// NetworkPage is the page returned by a pager when traversing over a -// collection of networks. -type NetworkPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of networks 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 NetworkPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"networks_links"` - } - - var r resp - err := mapstructure.Decode(p.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// IsEmpty checks whether a NetworkPage struct is empty. -func (p NetworkPage) IsEmpty() (bool, error) { - is, err := ExtractNetworks(p) - if err != nil { - return true, nil - } - return len(is) == 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/openstack/networking/v2/networks/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/urls.go deleted file mode 100644 index a9eecc52956..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/networks/urls.go +++ /dev/null @@ -1,31 +0,0 @@ -package networks - -import "github.com/rackspace/gophercloud" - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("networks", id) -} - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("networks") -} - -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 updateURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/doc.go deleted file mode 100644 index f16a4bb01be..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package ports contains functionality for working with Neutron port resources. -// A port represents a virtual switch port on a logical network switch. Virtual -// instances attach their interfaces into ports. The logical port also defines -// the MAC address and the IP address(es) to be assigned to the interfaces -// plugged into them. When IP addresses are associated to a port, this also -// implies the port is associated with a subnet, as the IP address was taken -// from the allocation pool for a specific subnet. -package ports diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/errors.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/errors.go deleted file mode 100644 index 111d977e749..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/errors.go +++ /dev/null @@ -1,11 +0,0 @@ -package ports - -import "fmt" - -func err(str string) error { - return fmt.Errorf("%s", str) -} - -var ( - errNetworkIDRequired = err("A Network ID is required") -) diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/requests.go deleted file mode 100644 index e73e10ac69c..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/requests.go +++ /dev/null @@ -1,268 +0,0 @@ -package ports - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - "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 -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToPortListQuery() (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 port attributes you want to see returned. SortKey allows you to sort -// by a particular port 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"` - AdminStateUp *bool `q:"admin_state_up"` - NetworkID string `q:"network_id"` - TenantID string `q:"tenant_id"` - DeviceOwner string `q:"device_owner"` - MACAddress string `q:"mac_address"` - ID string `q:"id"` - DeviceID string `q:"device_id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToPortListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToPortListQuery() (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 -// 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 ListOptsBuilder) pagination.Pager { - url := listURL(c) - if opts != nil { - query, err := opts.ToPortListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return PortPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// Get retrieves a specific port 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 { - ToPortCreateMap() (map[string]interface{}, error) -} - -// CreateOpts represents the attributes used when creating a new port. -type CreateOpts struct { - NetworkID string - Name string - AdminStateUp *bool - MACAddress string - FixedIPs interface{} - DeviceID string - DeviceOwner string - TenantID string - SecurityGroups []string - AllowedAddressPairs []AddressPair -} - -// ToPortCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToPortCreateMap() (map[string]interface{}, error) { - p := make(map[string]interface{}) - - if opts.NetworkID == "" { - return nil, errNetworkIDRequired - } - p["network_id"] = opts.NetworkID - - if opts.DeviceID != "" { - p["device_id"] = opts.DeviceID - } - if opts.DeviceOwner != "" { - p["device_owner"] = opts.DeviceOwner - } - if opts.FixedIPs != nil { - p["fixed_ips"] = opts.FixedIPs - } - if opts.SecurityGroups != nil { - p["security_groups"] = opts.SecurityGroups - } - if opts.TenantID != "" { - p["tenant_id"] = opts.TenantID - } - if opts.AdminStateUp != nil { - p["admin_state_up"] = &opts.AdminStateUp - } - if opts.Name != "" { - p["name"] = opts.Name - } - if opts.MACAddress != "" { - p["mac_address"] = opts.MACAddress - } - if opts.AllowedAddressPairs != nil { - p["allowed_address_pairs"] = opts.AllowedAddressPairs - } - - return map[string]interface{}{"port": p}, nil -} - -// Create accepts a CreateOpts struct and creates a new network using the values -// provided. You must remember to provide a NetworkID value. -func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToPortCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(createURL(c), reqBody, &res.Body, nil) - return res -} - -// 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 { - ToPortUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts represents the attributes used when updating an existing port. -type UpdateOpts struct { - Name string - AdminStateUp *bool - FixedIPs interface{} - DeviceID string - DeviceOwner string - SecurityGroups []string - AllowedAddressPairs []AddressPair -} - -// ToPortUpdateMap casts an UpdateOpts struct to a map. -func (opts UpdateOpts) ToPortUpdateMap() (map[string]interface{}, error) { - p := make(map[string]interface{}) - - if opts.DeviceID != "" { - p["device_id"] = opts.DeviceID - } - if opts.DeviceOwner != "" { - p["device_owner"] = opts.DeviceOwner - } - if opts.FixedIPs != nil { - p["fixed_ips"] = opts.FixedIPs - } - if opts.SecurityGroups != nil { - p["security_groups"] = opts.SecurityGroups - } - if opts.AdminStateUp != nil { - p["admin_state_up"] = &opts.AdminStateUp - } - if opts.Name != "" { - p["name"] = opts.Name - } - if opts.AllowedAddressPairs != nil { - p["allowed_address_pairs"] = opts.AllowedAddressPairs - } - - return map[string]interface{}{"port": p}, nil -} - -// Update accepts a UpdateOpts struct and updates an existing port using the -// values provided. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToPortUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(updateURL(c, id), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201}, - }) - return res -} - -// Delete accepts a unique ID and deletes the port associated with it. -func Delete(c *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(deleteURL(c, id), nil) - return res -} - -// IDFromName is a convenience function that returns a port's ID given its name. -func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { - portCount := 0 - portID := "" - if name == "" { - return "", fmt.Errorf("A port name must be provided.") - } - pager := List(client, nil) - pager.EachPage(func(page pagination.Page) (bool, error) { - portList, err := ExtractPorts(page) - if err != nil { - return false, err - } - - for _, p := range portList { - if p.Name == name { - portCount++ - portID = p.ID - } - } - return true, nil - }) - - switch portCount { - case 0: - return "", fmt.Errorf("Unable to find port: %s", name) - case 1: - return portID, nil - default: - return "", fmt.Errorf("Found %d ports matching %s", portCount, name) - } -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/results.go deleted file mode 100644 index 1f7eea1697a..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/results.go +++ /dev/null @@ -1,132 +0,0 @@ -package ports - -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 port resource. -func (r commonResult) Extract() (*Port, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Port *Port `json:"port"` - } - err := mapstructure.Decode(r.Body, &res) - - return res.Port, 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 { - gophercloud.ErrResult -} - -// IP is a sub-struct that represents an individual IP. -type IP struct { - SubnetID string `mapstructure:"subnet_id" json:"subnet_id"` - IPAddress string `mapstructure:"ip_address" json:"ip_address,omitempty"` -} - -type AddressPair struct { - IPAddress string `mapstructure:"ip_address" json:"ip_address,omitempty"` - MACAddress string `mapstructure:"mac_address" json:"mac_address,omitempty"` -} - -// Port represents a Neutron port. See package documentation for a top-level -// description of what this is. -type Port struct { - // UUID for the port. - ID string `mapstructure:"id" json:"id"` - // Network that this port is associated with. - NetworkID string `mapstructure:"network_id" json:"network_id"` - // Human-readable name for the port. Might not be unique. - Name string `mapstructure:"name" json:"name"` - // Administrative state of port. If false (down), port 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"` - // Mac address to use on this port. - MACAddress string `mapstructure:"mac_address" json:"mac_address"` - // Specifies IP addresses for the port thus associating the port itself with - // the subnets where the IP addresses are picked from - FixedIPs []IP `mapstructure:"fixed_ips" json:"fixed_ips"` - // Owner of network. Only admin users can specify a tenant_id other than its own. - TenantID string `mapstructure:"tenant_id" json:"tenant_id"` - // Identifies the entity (e.g.: dhcp agent) using this port. - DeviceOwner string `mapstructure:"device_owner" json:"device_owner"` - // Specifies the IDs of any security groups associated with a port. - SecurityGroups []string `mapstructure:"security_groups" json:"security_groups"` - // Identifies the device (e.g., virtual server) using this port. - DeviceID string `mapstructure:"device_id" json:"device_id"` - // Identifies the list of IP addresses the port will recognize/accept - AllowedAddressPairs []AddressPair `mapstructure:"allowed_address_pairs" json:"allowed_address_pairs"` -} - -// PortPage is the page returned by a pager when traversing over a collection -// of network ports. -type PortPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of ports 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 PortPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"ports_links"` - } - - var r resp - err := mapstructure.Decode(p.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// IsEmpty checks whether a PortPage struct is empty. -func (p PortPage) IsEmpty() (bool, error) { - is, err := ExtractPorts(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractPorts accepts a Page struct, specifically a PortPage struct, -// and extracts the elements into a slice of Port structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractPorts(page pagination.Page) ([]Port, error) { - var resp struct { - Ports []Port `mapstructure:"ports" json:"ports"` - } - - err := mapstructure.Decode(page.(PortPage).Body, &resp) - - return resp.Ports, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/urls.go deleted file mode 100644 index 6d0572f1fb2..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/ports/urls.go +++ /dev/null @@ -1,31 +0,0 @@ -package ports - -import "github.com/rackspace/gophercloud" - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("ports", id) -} - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("ports") -} - -func listURL(c *gophercloud.ServiceClient) string { - return rootURL(c) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} - -func createURL(c *gophercloud.ServiceClient) string { - return rootURL(c) -} - -func updateURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/doc.go deleted file mode 100644 index 43e8296c7f2..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/doc.go +++ /dev/null @@ -1,10 +0,0 @@ -// Package subnets contains functionality for working with Neutron subnet -// resources. A subnet represents an IP address block that can be used to -// assign IP addresses to virtual instances. Each subnet must have a CIDR and -// must be associated with a network. IPs can either be selected from the whole -// subnet CIDR or from allocation pools specified by the user. -// -// A subnet can also have a gateway, a list of DNS name servers, and host routes. -// This information is pushed to instances whose interfaces are associated with -// the subnet. -package subnets diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/errors.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/errors.go deleted file mode 100644 index 0db0a6e6047..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/errors.go +++ /dev/null @@ -1,13 +0,0 @@ -package subnets - -import "fmt" - -func err(str string) error { - return fmt.Errorf("%s", str) -} - -var ( - errNetworkIDRequired = err("A network ID is required") - errCIDRRequired = err("A valid CIDR is required") - errInvalidIPType = err("An IP type must either be 4 or 6") -) diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/requests.go deleted file mode 100644 index 6cde048ed04..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/requests.go +++ /dev/null @@ -1,271 +0,0 @@ -package subnets - -import ( - "fmt" - - "github.com/rackspace/gophercloud" - "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 -) - -// ListOptsBuilder allows extensions to add additional parameters to the -// List request. -type ListOptsBuilder interface { - ToSubnetListQuery() (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 subnet attributes you want to see returned. SortKey allows you to sort -// by a particular subnet attribute. SortDir sets the direction, and is either -// `asc' or `desc'. Marker and Limit are used for pagination. -type ListOpts struct { - Name string `q:"name"` - EnableDHCP *bool `q:"enable_dhcp"` - NetworkID string `q:"network_id"` - TenantID string `q:"tenant_id"` - IPVersion int `q:"ip_version"` - GatewayIP string `q:"gateway_ip"` - CIDR string `q:"cidr"` - ID string `q:"id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` -} - -// ToSubnetListQuery formats a ListOpts into a query string. -func (opts ListOpts) ToSubnetListQuery() (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 -// 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 ListOptsBuilder) pagination.Pager { - url := listURL(c) - if opts != nil { - query, err := opts.ToSubnetListQuery() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - } - - return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page { - return SubnetPage{pagination.LinkedPageBase{PageResult: r}} - }) -} - -// Get retrieves a specific subnet 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 -} - -// Valid IP types -const ( - IPv4 = 4 - IPv6 = 6 -) - -// 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 { - ToSubnetCreateMap() (map[string]interface{}, error) -} - -// CreateOpts represents the attributes used when creating a new subnet. -type CreateOpts struct { - // Required - NetworkID string - CIDR string - // Optional - Name string - TenantID string - AllocationPools []AllocationPool - GatewayIP string - IPVersion int - EnableDHCP *bool - DNSNameservers []string - HostRoutes []HostRoute -} - -// ToSubnetCreateMap casts a CreateOpts struct to a map. -func (opts CreateOpts) ToSubnetCreateMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - - if opts.NetworkID == "" { - return nil, errNetworkIDRequired - } - if opts.CIDR == "" { - return nil, errCIDRRequired - } - if opts.IPVersion != 0 && opts.IPVersion != IPv4 && opts.IPVersion != IPv6 { - return nil, errInvalidIPType - } - - s["network_id"] = opts.NetworkID - s["cidr"] = opts.CIDR - - if opts.EnableDHCP != nil { - s["enable_dhcp"] = &opts.EnableDHCP - } - if opts.Name != "" { - s["name"] = opts.Name - } - if opts.GatewayIP != "" { - s["gateway_ip"] = opts.GatewayIP - } - if opts.TenantID != "" { - s["tenant_id"] = opts.TenantID - } - if opts.IPVersion != 0 { - s["ip_version"] = opts.IPVersion - } - if len(opts.AllocationPools) != 0 { - s["allocation_pools"] = opts.AllocationPools - } - if len(opts.DNSNameservers) != 0 { - s["dns_nameservers"] = opts.DNSNameservers - } - if len(opts.HostRoutes) != 0 { - s["host_routes"] = opts.HostRoutes - } - - return map[string]interface{}{"subnet": s}, nil -} - -// 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 CreateOptsBuilder) CreateResult { - var res CreateResult - - reqBody, err := opts.ToSubnetCreateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Post(createURL(c), reqBody, &res.Body, nil) - return res -} - -// UpdateOptsBuilder allows extensions to add additional parameters to the -// Update request. -type UpdateOptsBuilder interface { - ToSubnetUpdateMap() (map[string]interface{}, error) -} - -// UpdateOpts represents the attributes used when updating an existing subnet. -type UpdateOpts struct { - Name string - GatewayIP string - DNSNameservers []string - HostRoutes []HostRoute - EnableDHCP *bool -} - -// ToSubnetUpdateMap casts an UpdateOpts struct to a map. -func (opts UpdateOpts) ToSubnetUpdateMap() (map[string]interface{}, error) { - s := make(map[string]interface{}) - - if opts.EnableDHCP != nil { - s["enable_dhcp"] = &opts.EnableDHCP - } - if opts.Name != "" { - s["name"] = opts.Name - } - if opts.GatewayIP != "" { - s["gateway_ip"] = opts.GatewayIP - } - if opts.DNSNameservers != nil { - s["dns_nameservers"] = opts.DNSNameservers - } - if opts.HostRoutes != nil { - s["host_routes"] = opts.HostRoutes - } - - return map[string]interface{}{"subnet": s}, nil -} - -// Update accepts a UpdateOpts struct and updates an existing subnet using the -// values provided. -func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - - reqBody, err := opts.ToSubnetUpdateMap() - if err != nil { - res.Err = err - return res - } - - _, res.Err = c.Put(updateURL(c, id), reqBody, &res.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200, 201}, - }) - - return res -} - -// Delete accepts a unique ID and deletes the subnet associated with it. -func Delete(c *gophercloud.ServiceClient, id string) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(deleteURL(c, id), nil) - return res -} - -// IDFromName is a convenience function that returns a subnet's ID given its name. -func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { - subnetCount := 0 - subnetID := "" - if name == "" { - return "", fmt.Errorf("A subnet name must be provided.") - } - pager := List(client, nil) - pager.EachPage(func(page pagination.Page) (bool, error) { - subnetList, err := ExtractSubnets(page) - if err != nil { - return false, err - } - - for _, s := range subnetList { - if s.Name == name { - subnetCount++ - subnetID = s.ID - } - } - return true, nil - }) - - switch subnetCount { - case 0: - return "", fmt.Errorf("Unable to find subnet: %s", name) - case 1: - return subnetID, nil - default: - return "", fmt.Errorf("Found %d subnets matching %s", subnetCount, name) - } -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results.go deleted file mode 100644 index 77b956a17ef..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/results.go +++ /dev/null @@ -1,132 +0,0 @@ -package subnets - -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 subnet resource. -func (r commonResult) Extract() (*Subnet, error) { - if r.Err != nil { - return nil, r.Err - } - - var res struct { - Subnet *Subnet `json:"subnet"` - } - - err := mapstructure.Decode(r.Body, &res) - - return res.Subnet, 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 { - gophercloud.ErrResult -} - -// AllocationPool represents a sub-range of cidr available for dynamic -// allocation to ports, e.g. {Start: "10.0.0.2", End: "10.0.0.254"} -type AllocationPool struct { - Start string `json:"start"` - End string `json:"end"` -} - -// HostRoute represents a route that should be used by devices with IPs from -// a subnet (not including local subnet route). -type HostRoute struct { - DestinationCIDR string `mapstructure:"destination" json:"destination"` - NextHop string `mapstructure:"nexthop" json:"nexthop"` -} - -// Subnet represents a subnet. See package documentation for a top-level -// description of what this is. -type Subnet struct { - // UUID representing the subnet - ID string `mapstructure:"id" json:"id"` - // UUID of the parent network - NetworkID string `mapstructure:"network_id" json:"network_id"` - // Human-readable name for the subnet. Might not be unique. - Name string `mapstructure:"name" json:"name"` - // IP version, either `4' or `6' - IPVersion int `mapstructure:"ip_version" json:"ip_version"` - // CIDR representing IP range for this subnet, based on IP version - CIDR string `mapstructure:"cidr" json:"cidr"` - // Default gateway used by devices in this subnet - GatewayIP string `mapstructure:"gateway_ip" json:"gateway_ip"` - // DNS name servers used by hosts in this subnet. - DNSNameservers []string `mapstructure:"dns_nameservers" json:"dns_nameservers"` - // Sub-ranges of CIDR available for dynamic allocation to ports. See AllocationPool. - AllocationPools []AllocationPool `mapstructure:"allocation_pools" json:"allocation_pools"` - // Routes that should be used by devices with IPs from this subnet (not including local subnet route). - HostRoutes []HostRoute `mapstructure:"host_routes" json:"host_routes"` - // Specifies whether DHCP is enabled for this subnet or not. - EnableDHCP bool `mapstructure:"enable_dhcp" json:"enable_dhcp"` - // Owner of network. Only admin users can specify a tenant_id other than its own. - TenantID string `mapstructure:"tenant_id" json:"tenant_id"` -} - -// SubnetPage is the page returned by a pager when traversing over a collection -// of subnets. -type SubnetPage struct { - pagination.LinkedPageBase -} - -// NextPageURL is invoked when a paginated collection of subnets 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 SubnetPage) NextPageURL() (string, error) { - type resp struct { - Links []gophercloud.Link `mapstructure:"subnets_links"` - } - - var r resp - err := mapstructure.Decode(p.Body, &r) - if err != nil { - return "", err - } - - return gophercloud.ExtractNextURL(r.Links) -} - -// IsEmpty checks whether a SubnetPage struct is empty. -func (p SubnetPage) IsEmpty() (bool, error) { - is, err := ExtractSubnets(p) - if err != nil { - return true, nil - } - return len(is) == 0, nil -} - -// ExtractSubnets accepts a Page struct, specifically a SubnetPage struct, -// and extracts the elements into a slice of Subnet structs. In other words, -// a generic collection is mapped into a relevant slice. -func ExtractSubnets(page pagination.Page) ([]Subnet, error) { - var resp struct { - Subnets []Subnet `mapstructure:"subnets" json:"subnets"` - } - - err := mapstructure.Decode(page.(SubnetPage).Body, &resp) - - return resp.Subnets, err -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/urls.go deleted file mode 100644 index 0d023689415..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/networking/v2/subnets/urls.go +++ /dev/null @@ -1,31 +0,0 @@ -package subnets - -import "github.com/rackspace/gophercloud" - -func resourceURL(c *gophercloud.ServiceClient, id string) string { - return c.ServiceURL("subnets", id) -} - -func rootURL(c *gophercloud.ServiceClient) string { - return c.ServiceURL("subnets") -} - -func listURL(c *gophercloud.ServiceClient) string { - return rootURL(c) -} - -func getURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} - -func createURL(c *gophercloud.ServiceClient) string { - return rootURL(c) -} - -func updateURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} - -func deleteURL(c *gophercloud.ServiceClient, id string) string { - return resourceURL(c, id) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/doc.go deleted file mode 100644 index f5f894a9e56..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package accounts contains functionality for working with Object Storage -// account resources. An account is the top-level resource the object storage -// hierarchy: containers belong to accounts, objects belong to containers. -// -// Another way of thinking of an account is like a namespace for all your -// resources. It is synonymous with a project or tenant in other OpenStack -// services. -package accounts diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/fixtures.go deleted file mode 100644 index f22b6870053..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/fixtures.go +++ /dev/null @@ -1,38 +0,0 @@ -// +build fixtures - -package accounts - -import ( - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// HandleGetAccountSuccessfully creates an HTTP handler at `/` on the test handler mux that -// responds with a `Get` response. -func HandleGetAccountSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "HEAD") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - - w.Header().Set("X-Account-Container-Count", "2") - w.Header().Set("X-Account-Bytes-Used", "14") - w.Header().Set("X-Account-Meta-Subject", "books") - - w.WriteHeader(http.StatusNoContent) - }) -} - -// HandleUpdateAccountSuccessfully creates an HTTP handler at `/` on the test handler mux that -// responds with a `Update` response. -func HandleUpdateAccountSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/", 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, "X-Account-Meta-Gophercloud-Test", "accounts") - - w.WriteHeader(http.StatusNoContent) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/requests.go deleted file mode 100644 index 66c46a9787b..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/requests.go +++ /dev/null @@ -1,107 +0,0 @@ -package accounts - -import "github.com/rackspace/gophercloud" - -// GetOptsBuilder allows extensions to add additional headers to the Get -// request. -type GetOptsBuilder interface { - ToAccountGetMap() (map[string]string, error) -} - -// GetOpts is a structure that contains parameters for getting an account's -// metadata. -type GetOpts struct { - Newest bool `h:"X-Newest"` -} - -// ToAccountGetMap formats a GetOpts into a map[string]string of headers. -func (opts GetOpts) ToAccountGetMap() (map[string]string, error) { - return gophercloud.BuildHeaders(opts) -} - -// 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, opts GetOptsBuilder) GetResult { - var res GetResult - h := c.AuthenticatedHeaders() - - if opts != nil { - headers, err := opts.ToAccountGetMap() - if err != nil { - res.Err = err - return res - } - - for k, v := range headers { - h[k] = v - } - } - - resp, err := c.Request("HEAD", getURL(c), gophercloud.RequestOpts{ - MoreHeaders: h, - OkCodes: []int{204}, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} - -// UpdateOptsBuilder allows extensions to add additional headers to the Update -// request. -type UpdateOptsBuilder interface { - ToAccountUpdateMap() (map[string]string, error) -} - -// UpdateOpts is a structure that contains parameters for updating, creating, or -// deleting an account's metadata. -type UpdateOpts struct { - Metadata map[string]string - ContentType string `h:"Content-Type"` - DetectContentType bool `h:"X-Detect-Content-Type"` - 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 is a function that creates, updates, or deletes an account's metadata. -// To extract the headers returned, call the Extract method on the UpdateResult. -func Update(c *gophercloud.ServiceClient, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - h := make(map[string]string) - - if opts != nil { - headers, err := opts.ToAccountUpdateMap() - if err != nil { - res.Err = err - return res - } - for k, v := range headers { - h[k] = v - } - } - - resp, err := c.Request("POST", updateURL(c), gophercloud.RequestOpts{ - MoreHeaders: h, - OkCodes: []int{201, 202, 204}, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/results.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/results.go deleted file mode 100644 index 6ab1a230617..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/results.go +++ /dev/null @@ -1,102 +0,0 @@ -package accounts - -import ( - "strings" - "time" - - "github.com/rackspace/gophercloud" -) - -// UpdateResult is returned from a call to the Update function. -type UpdateResult struct { - gophercloud.HeaderResult -} - -// UpdateHeader represents the headers returned in the response from an Update request. -type UpdateHeader struct { - ContentLength string `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// 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 (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 -} - -// GetHeader represents the headers returned in the response from a Get request. -type GetHeader struct { - BytesUsed int64 `mapstructure:"X-Account-Bytes-Used"` - ContainerCount int `mapstructure:"X-Account-Container-Count"` - ContentLength int64 `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - ObjectCount int64 `mapstructure:"X-Account-Object-Count"` - TransID string `mapstructure:"X-Trans-Id"` - TempURLKey string `mapstructure:"X-Account-Meta-Temp-URL-Key"` - TempURLKey2 string `mapstructure:"X-Account-Meta-Temp-URL-Key-2"` -} - -// GetResult is returned from a call to the Get function. -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 metatdata associated with the account. -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-Account-Meta-") { - key := strings.TrimPrefix(k, "X-Account-Meta-") - metadata[key] = v[0] - } - } - return metadata, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/urls.go deleted file mode 100644 index 9952fe43451..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts/urls.go +++ /dev/null @@ -1,11 +0,0 @@ -package accounts - -import "github.com/rackspace/gophercloud" - -func getURL(c *gophercloud.ServiceClient) string { - return c.Endpoint -} - -func updateURL(c *gophercloud.ServiceClient) string { - return getURL(c) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/doc.go deleted file mode 100644 index 5fed5537f13..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package containers contains functionality for working with Object Storage -// container resources. A container serves as a logical namespace for objects -// that are placed inside it - an object with the same name in two different -// containers represents two different objects. -// -// In addition to containing objects, you can also use the container to control -// access to objects by using an access control list (ACL). -package containers diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/fixtures.go deleted file mode 100644 index e60735248fe..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/fixtures.go +++ /dev/null @@ -1,143 +0,0 @@ -// +build fixtures - -package containers - -import ( - "fmt" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// ExpectedListInfo is the result expected from a call to `List` when full -// info is requested. -var ExpectedListInfo = []Container{ - Container{ - Count: 0, - Bytes: 0, - Name: "janeausten", - }, - Container{ - Count: 1, - Bytes: 14, - Name: "marktwain", - }, -} - -// ExpectedListNames is the result expected from a call to `List` when just -// container names are requested. -var ExpectedListNames = []string{"janeausten", "marktwain"} - -// HandleListContainerInfoSuccessfully creates an HTTP handler at `/` on the test handler mux that -// responds with a `List` response when full info is requested. -func HandleListContainerInfoSuccessfully(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.Header().Set("Content-Type", "application/json") - r.ParseForm() - marker := r.Form.Get("marker") - switch marker { - case "": - fmt.Fprintf(w, `[ - { - "count": 0, - "bytes": 0, - "name": "janeausten" - }, - { - "count": 1, - "bytes": 14, - "name": "marktwain" - } - ]`) - case "janeausten": - fmt.Fprintf(w, `[ - { - "count": 1, - "bytes": 14, - "name": "marktwain" - } - ]`) - case "marktwain": - fmt.Fprintf(w, `[]`) - default: - t.Fatalf("Unexpected marker: [%s]", marker) - } - }) -} - -// HandleListContainerNamesSuccessfully creates an HTTP handler at `/` on the test handler mux that -// responds with a `ListNames` response when only container names are requested. -func HandleListContainerNamesSuccessfully(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", "text/plain") - - w.Header().Set("Content-Type", "text/plain") - r.ParseForm() - marker := r.Form.Get("marker") - switch marker { - case "": - fmt.Fprintf(w, "janeausten\nmarktwain\n") - case "janeausten": - fmt.Fprintf(w, "marktwain\n") - case "marktwain": - fmt.Fprintf(w, ``) - default: - t.Fatalf("Unexpected marker: [%s]", marker) - } - }) -} - -// HandleCreateContainerSuccessfully creates an HTTP handler at `/testContainer` on the test handler mux that -// responds with a `Create` response. -func HandleCreateContainerSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer", 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().Add("X-Container-Meta-Foo", "bar") - w.Header().Add("X-Trans-Id", "1234567") - w.WriteHeader(http.StatusNoContent) - }) -} - -// HandleDeleteContainerSuccessfully creates an HTTP handler at `/testContainer` on the test handler mux that -// responds with a `Delete` response. -func HandleDeleteContainerSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer", 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.WriteHeader(http.StatusNoContent) - }) -} - -// HandleUpdateContainerSuccessfully creates an HTTP handler at `/testContainer` on the test handler mux that -// responds with a `Update` response. -func HandleUpdateContainerSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer", 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.StatusNoContent) - }) -} - -// HandleGetContainerSuccessfully creates an HTTP handler at `/testContainer` on the test handler mux that -// responds with a `Get` response. -func HandleGetContainerSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "HEAD") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - w.WriteHeader(http.StatusNoContent) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/requests.go deleted file mode 100644 index 50ff9f48f3b..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/requests.go +++ /dev/null @@ -1,205 +0,0 @@ -package containers - -import ( - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" -) - -// ListOptsBuilder allows extensions to add additional parameters to the List -// request. -type ListOptsBuilder interface { - ToContainerListParams() (bool, string, error) -} - -// ListOpts is a structure that holds options for listing containers. -type ListOpts struct { - Full bool - Limit int `q:"limit"` - Marker string `q:"marker"` - EndMarker string `q:"end_marker"` - Format string `q:"format"` - Prefix string `q:"prefix"` - Delimiter string `q:"delimiter"` -} - -// 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 opts.Full, 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 ListOptsBuilder) pagination.Pager { - headers := map[string]string{"Accept": "text/plain", "Content-Type": "text/plain"} - - url := listURL(c) - if opts != nil { - full, query, err := opts.ToContainerListParams() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - - if full { - headers = map[string]string{"Accept": "application/json", "Content-Type": "application/json"} - } - } - - createPage := func(r pagination.PageResult) pagination.Page { - p := ContainerPage{pagination.MarkerPageBase{PageResult: r}} - p.MarkerPageBase.Owner = p - return p - } - - pager := pagination.NewPager(c, url, createPage) - pager.Headers = headers - return pager -} - -// CreateOptsBuilder allows extensions to add additional parameters to the -// Create request. -type CreateOptsBuilder interface { - ToContainerCreateMap() (map[string]string, error) -} - -// CreateOpts is a structure that holds parameters for creating a container. -type CreateOpts struct { - Metadata map[string]string - ContainerRead string `h:"X-Container-Read"` - ContainerSyncTo string `h:"X-Container-Sync-To"` - ContainerSyncKey string `h:"X-Container-Sync-Key"` - ContainerWrite string `h:"X-Container-Write"` - ContentType string `h:"Content-Type"` - DetectContentType bool `h:"X-Detect-Content-Type"` - IfNoneMatch string `h:"If-None-Match"` - 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 CreateOptsBuilder) CreateResult { - var res CreateResult - h := c.AuthenticatedHeaders() - - if opts != nil { - headers, err := opts.ToContainerCreateMap() - if err != nil { - res.Err = err - return res - } - - for k, v := range headers { - h[k] = v - } - } - - resp, err := c.Request("PUT", createURL(c, containerName), gophercloud.RequestOpts{ - MoreHeaders: h, - OkCodes: []int{201, 202, 204}, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} - -// Delete is a function that deletes a container. -func Delete(c *gophercloud.ServiceClient, containerName string) DeleteResult { - var res DeleteResult - _, res.Err = c.Delete(deleteURL(c, containerName), nil) - return res -} - -// 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 { - Metadata map[string]string - ContainerRead string `h:"X-Container-Read"` - ContainerSyncTo string `h:"X-Container-Sync-To"` - ContainerSyncKey string `h:"X-Container-Sync-Key"` - 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 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{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 -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/results.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/results.go deleted file mode 100644 index e682b8dccbf..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/results.go +++ /dev/null @@ -1,270 +0,0 @@ -package containers - -import ( - "fmt" - "strings" - "time" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - - "github.com/mitchellh/mapstructure" -) - -// Container represents a container resource. -type Container struct { - // The total number of bytes stored in the container. - Bytes int `json:"bytes" mapstructure:"bytes"` - - // The total number of objects stored in the container. - Count int `json:"count" mapstructure:"count"` - - // The name of the container. - Name string `json:"name" mapstructure:"name"` -} - -// ContainerPage is the page returned by a pager when traversing over a -// collection of containers. -type ContainerPage struct { - pagination.MarkerPageBase -} - -// IsEmpty returns true if a ListResult contains no container names. -func (r ContainerPage) IsEmpty() (bool, error) { - names, err := ExtractNames(r) - if err != nil { - return true, err - } - return len(names) == 0, nil -} - -// LastMarker returns the last container name in a ListResult. -func (r ContainerPage) LastMarker() (string, error) { - names, err := ExtractNames(r) - if err != nil { - return "", err - } - if len(names) == 0 { - return "", nil - } - return names[len(names)-1], nil -} - -// ExtractInfo is a function that takes a ListResult and returns the containers' information. -func ExtractInfo(page pagination.Page) ([]Container, error) { - untyped := page.(ContainerPage).Body.([]interface{}) - results := make([]Container, len(untyped)) - for index, each := range untyped { - container := each.(map[string]interface{}) - err := mapstructure.Decode(container, &results[index]) - if err != nil { - return results, err - } - } - return results, nil -} - -// ExtractNames is a function that takes a ListResult and returns the containers' names. -func ExtractNames(page pagination.Page) ([]string, error) { - casted := page.(ContainerPage) - ct := casted.Header.Get("Content-Type") - - switch { - case strings.HasPrefix(ct, "application/json"): - parsed, err := ExtractInfo(page) - if err != nil { - return nil, err - } - - names := make([]string, 0, len(parsed)) - for _, container := range parsed { - names = append(names, container.Name) - } - return names, nil - case strings.HasPrefix(ct, "text/plain"): - names := make([]string, 0, 50) - - body := string(page.(ContainerPage).Body.([]uint8)) - for _, name := range strings.Split(body, "\n") { - if len(name) > 0 { - names = append(names, name) - } - } - - return names, nil - default: - return nil, fmt.Errorf("Cannot extract names from response with content-type: [%s]", ct) - } -} - -// GetHeader represents the headers returned in the response from a Get request. -type GetHeader struct { - AcceptRanges string `mapstructure:"Accept-Ranges"` - BytesUsed int64 `mapstructure:"X-Account-Bytes-Used"` - ContentLength int64 `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - ObjectCount int64 `mapstructure:"X-Container-Object-Count"` - Read string `mapstructure:"X-Container-Read"` - TransID string `mapstructure:"X-Trans-Id"` - VersionsLocation string `mapstructure:"X-Versions-Location"` - Write string `mapstructure:"X-Container-Write"` -} - -// 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 -} - -// CreateHeader represents the headers returned in the response from a Create request. -type CreateHeader struct { - ContentLength int64 `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// CreateResult represents the result of a create operation. To extract the -// the headers from the HTTP response, you can invoke the 'ExtractHeader' -// method on the result struct. -type CreateResult struct { - gophercloud.HeaderResult -} - -// Extract will return a struct of headers returned from a call to Create. To obtain -// a map of headers, call the ExtractHeader method on the CreateResult. -func (cr CreateResult) Extract() (CreateHeader, error) { - var ch CreateHeader - if cr.Err != nil { - return ch, cr.Err - } - - if err := gophercloud.DecodeHeader(cr.Header, &ch); err != nil { - return ch, err - } - - if date, ok := cr.Header["Date"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, cr.Header["Date"][0]) - if err != nil { - return ch, err - } - ch.Date = t - } - - return ch, nil -} - -// UpdateHeader represents the headers returned in the response from a Update request. -type UpdateHeader struct { - ContentLength int64 `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 -} - -// DeleteHeader represents the headers returned in the response from a Delete request. -type DeleteHeader struct { - ContentLength int64 `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// DeleteResult represents the result of a delete operation. To extract the -// the headers from the HTTP response, you can invoke the 'ExtractHeader' -// method on the result struct. -type DeleteResult struct { - gophercloud.HeaderResult -} - -// Extract will return a struct of headers returned from a call to Delete. To obtain -// a map of headers, call the ExtractHeader method on the DeleteResult. -func (dr DeleteResult) Extract() (DeleteHeader, error) { - var dh DeleteHeader - if dr.Err != nil { - return dh, dr.Err - } - - if err := gophercloud.DecodeHeader(dr.Header, &dh); err != nil { - return dh, err - } - - if date, ok := dr.Header["Date"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, dr.Header["Date"][0]) - if err != nil { - return dh, err - } - dh.Date = t - } - - return dh, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/urls.go deleted file mode 100644 index f864f846eb2..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/containers/urls.go +++ /dev/null @@ -1,23 +0,0 @@ -package containers - -import "github.com/rackspace/gophercloud" - -func listURL(c *gophercloud.ServiceClient) string { - return c.Endpoint -} - -func createURL(c *gophercloud.ServiceClient, container string) string { - return c.ServiceURL(container) -} - -func getURL(c *gophercloud.ServiceClient, container string) string { - return createURL(c, container) -} - -func deleteURL(c *gophercloud.ServiceClient, container string) string { - return createURL(c, container) -} - -func updateURL(c *gophercloud.ServiceClient, container string) string { - return createURL(c, container) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/doc.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/doc.go deleted file mode 100644 index 30a9adde1ca..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package objects contains functionality for working with Object Storage -// object resources. An object is a resource that represents and contains data -// - such as documents, images, and so on. You can also store custom metadata -// with an object. -package objects diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/fixtures.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/fixtures.go deleted file mode 100644 index 7a6e6e1ee77..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/fixtures.go +++ /dev/null @@ -1,195 +0,0 @@ -// +build fixtures - -package objects - -import ( - "crypto/md5" - "fmt" - "io" - "net/http" - "testing" - - th "github.com/rackspace/gophercloud/testhelper" - fake "github.com/rackspace/gophercloud/testhelper/client" -) - -// HandleDownloadObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that -// responds with a `Download` response. -func HandleDownloadObjectSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer/testObject", 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, "Successful download with Gophercloud") - }) -} - -// ExpectedListInfo is the result expected from a call to `List` when full -// info is requested. -var ExpectedListInfo = []Object{ - Object{ - Hash: "451e372e48e0f6b1114fa0724aa79fa1", - LastModified: "2009-11-10 23:00:00 +0000 UTC", - Bytes: 14, - Name: "goodbye", - ContentType: "application/octet-stream", - }, - Object{ - Hash: "451e372e48e0f6b1114fa0724aa79fa1", - LastModified: "2009-11-10 23:00:00 +0000 UTC", - Bytes: 14, - Name: "hello", - ContentType: "application/octet-stream", - }, -} - -// ExpectedListNames is the result expected from a call to `List` when just -// object names are requested. -var ExpectedListNames = []string{"hello", "goodbye"} - -// HandleListObjectsInfoSuccessfully creates an HTTP handler at `/testContainer` on the test handler mux that -// responds with a `List` response when full info is requested. -func HandleListObjectsInfoSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer", 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, `[ - { - "hash": "451e372e48e0f6b1114fa0724aa79fa1", - "last_modified": "2009-11-10 23:00:00 +0000 UTC", - "bytes": 14, - "name": "goodbye", - "content_type": "application/octet-stream" - }, - { - "hash": "451e372e48e0f6b1114fa0724aa79fa1", - "last_modified": "2009-11-10 23:00:00 +0000 UTC", - "bytes": 14, - "name": "hello", - "content_type": "application/octet-stream" - } - ]`) - case "hello": - fmt.Fprintf(w, `[]`) - default: - t.Fatalf("Unexpected marker: [%s]", marker) - } - }) -} - -// HandleListObjectNamesSuccessfully creates an HTTP handler at `/testContainer` on the test handler mux that -// responds with a `List` response when only object names are requested. -func HandleListObjectNamesSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer", 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", "text/plain") - - w.Header().Set("Content-Type", "text/plain") - r.ParseForm() - marker := r.Form.Get("marker") - switch marker { - case "": - fmt.Fprintf(w, "hello\ngoodbye\n") - case "goodbye": - fmt.Fprintf(w, "") - default: - t.Fatalf("Unexpected marker: [%s]", marker) - } - }) -} - -// HandleCreateTextObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux -// that responds with a `Create` response. A Content-Type of "text/plain" is expected. -func HandleCreateTextObjectSuccessfully(t *testing.T, content string) { - th.Mux.HandleFunc("/testContainer/testObject", 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", "text/plain") - th.TestHeader(t, r, "Accept", "application/json") - - hash := md5.New() - io.WriteString(hash, content) - localChecksum := hash.Sum(nil) - - w.Header().Set("ETag", fmt.Sprintf("%x", localChecksum)) - w.WriteHeader(http.StatusCreated) - }) -} - -// HandleCreateTypelessObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler -// mux that responds with a `Create` response. No Content-Type header may be present in the request, so that server- -// side content-type detection will be triggered properly. -func HandleCreateTypelessObjectSuccessfully(t *testing.T, content string) { - th.Mux.HandleFunc("/testContainer/testObject", 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") - - if contentType, present := r.Header["Content-Type"]; present { - t.Errorf("Expected Content-Type header to be omitted, but was %#v", contentType) - } - - hash := md5.New() - io.WriteString(hash, content) - localChecksum := hash.Sum(nil) - - w.Header().Set("ETag", fmt.Sprintf("%x", localChecksum)) - w.WriteHeader(http.StatusCreated) - }) -} - -// HandleCopyObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that -// responds with a `Copy` response. -func HandleCopyObjectSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer/testObject", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "COPY") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - th.TestHeader(t, r, "Destination", "/newTestContainer/newTestObject") - w.WriteHeader(http.StatusCreated) - }) -} - -// HandleDeleteObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that -// responds with a `Delete` response. -func HandleDeleteObjectSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer/testObject", 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.WriteHeader(http.StatusNoContent) - }) -} - -// HandleUpdateObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that -// responds with a `Update` response. -func HandleUpdateObjectSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer/testObject", 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") - th.TestHeader(t, r, "X-Object-Meta-Gophercloud-Test", "objects") - w.WriteHeader(http.StatusAccepted) - }) -} - -// HandleGetObjectSuccessfully creates an HTTP handler at `/testContainer/testObject` on the test handler mux that -// responds with a `Get` response. -func HandleGetObjectSuccessfully(t *testing.T) { - th.Mux.HandleFunc("/testContainer/testObject", func(w http.ResponseWriter, r *http.Request) { - th.TestMethod(t, r, "HEAD") - th.TestHeader(t, r, "X-Auth-Token", fake.TokenID) - th.TestHeader(t, r, "Accept", "application/json") - w.Header().Add("X-Object-Meta-Gophercloud-Test", "objects") - w.WriteHeader(http.StatusNoContent) - }) -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests.go deleted file mode 100644 index f85add0b9ab..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/requests.go +++ /dev/null @@ -1,501 +0,0 @@ -package objects - -import ( - "bufio" - "crypto/hmac" - "crypto/md5" - "crypto/sha1" - "fmt" - "io" - "io/ioutil" - "strings" - "time" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack/objectstorage/v1/accounts" - "github.com/rackspace/gophercloud/pagination" -) - -// ListOptsBuilder allows extensions to add additional parameters to the List -// request. -type ListOptsBuilder interface { - ToObjectListParams() (bool, string, error) -} - -// ListOpts is a structure that holds parameters for listing objects. -type ListOpts struct { - // Full is a true/false value that represents the amount of object information - // returned. If Full is set to true, then the content-type, number of bytes, hash - // date last modified, and name are returned. If set to false or not set, then - // only the object names are returned. - Full bool - Limit int `q:"limit"` - Marker string `q:"marker"` - EndMarker string `q:"end_marker"` - Format string `q:"format"` - Prefix string `q:"prefix"` - Delimiter string `q:"delimiter"` - Path string `q:"path"` -} - -// ToObjectListParams formats a ListOpts into a query string and boolean -// representing whether to list complete information for each object. -func (opts ListOpts) ToObjectListParams() (bool, string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return false, "", err - } - return opts.Full, q.String(), nil -} - -// List is a function that retrieves all objects in a container. It also returns the details -// for the container. To extract only the object information or names, pass the ListResult -// response to the ExtractInfo or ExtractNames function, respectively. -func List(c *gophercloud.ServiceClient, containerName string, opts ListOptsBuilder) pagination.Pager { - headers := map[string]string{"Accept": "text/plain", "Content-Type": "text/plain"} - - url := listURL(c, containerName) - if opts != nil { - full, query, err := opts.ToObjectListParams() - if err != nil { - return pagination.Pager{Err: err} - } - url += query - - if full { - headers = map[string]string{"Accept": "application/json", "Content-Type": "application/json"} - } - } - - createPage := func(r pagination.PageResult) pagination.Page { - p := ObjectPage{pagination.MarkerPageBase{PageResult: r}} - p.MarkerPageBase.Owner = p - return p - } - - pager := pagination.NewPager(c, url, createPage) - pager.Headers = headers - return pager -} - -// DownloadOptsBuilder allows extensions to add additional parameters to the -// Download request. -type DownloadOptsBuilder interface { - ToObjectDownloadParams() (map[string]string, string, error) -} - -// DownloadOpts is a structure that holds parameters for downloading an object. -type DownloadOpts struct { - IfMatch string `h:"If-Match"` - IfModifiedSince time.Time `h:"If-Modified-Since"` - IfNoneMatch string `h:"If-None-Match"` - IfUnmodifiedSince time.Time `h:"If-Unmodified-Since"` - Range string `h:"Range"` - Expires string `q:"expires"` - MultipartManifest string `q:"multipart-manifest"` - Signature string `q:"signature"` -} - -// ToObjectDownloadParams formats a DownloadOpts into a query string and map of -// headers. -func (opts DownloadOpts) ToObjectDownloadParams() (map[string]string, string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return nil, "", err - } - h, err := gophercloud.BuildHeaders(opts) - if err != nil { - return nil, q.String(), err - } - return h, q.String(), nil -} - -// 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 DownloadOptsBuilder) DownloadResult { - var res DownloadResult - - url := downloadURL(c, containerName, objectName) - h := c.AuthenticatedHeaders() - - if opts != nil { - headers, query, err := opts.ToObjectDownloadParams() - if err != nil { - res.Err = err - return res - } - - for k, v := range headers { - h[k] = v - } - - url += query - } - - resp, err := c.Request("GET", url, gophercloud.RequestOpts{ - MoreHeaders: h, - OkCodes: []int{200, 304}, - }) - if resp != nil { - res.Header = resp.Header - res.Body = resp.Body - } - res.Err = err - - return res -} - -// CreateOptsBuilder allows extensions to add additional parameters to the -// Create request. -type CreateOptsBuilder interface { - ToObjectCreateParams() (map[string]string, string, error) -} - -// CreateOpts is a structure that holds parameters for creating an object. -type CreateOpts struct { - Metadata map[string]string - ContentDisposition string `h:"Content-Disposition"` - ContentEncoding string `h:"Content-Encoding"` - ContentLength int64 `h:"Content-Length"` - ContentType string `h:"Content-Type"` - CopyFrom string `h:"X-Copy-From"` - DeleteAfter int `h:"X-Delete-After"` - DeleteAt int `h:"X-Delete-At"` - DetectContentType string `h:"X-Detect-Content-Type"` - ETag string `h:"ETag"` - IfNoneMatch string `h:"If-None-Match"` - ObjectManifest string `h:"X-Object-Manifest"` - TransferEncoding string `h:"Transfer-Encoding"` - Expires string `q:"expires"` - MultipartManifest string `q:"multipart-manifest"` - Signature string `q:"signature"` -} - -// ToObjectCreateParams formats a CreateOpts into a query string and map of -// headers. -func (opts CreateOpts) ToObjectCreateParams() (map[string]string, string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return nil, "", err - } - h, err := gophercloud.BuildHeaders(opts) - if err != nil { - return nil, q.String(), err - } - - for k, v := range opts.Metadata { - h["X-Object-Meta-"+k] = v - } - - return h, q.String(), nil -} - -// Create is a function that creates a new object or replaces an existing object. If the returned response's ETag -// header fails to match the local checksum, the failed request will automatically be retried up to a maximum of 3 times. -func Create(c *gophercloud.ServiceClient, containerName, objectName string, content io.ReadSeeker, opts CreateOptsBuilder) CreateResult { - var res CreateResult - - url := createURL(c, containerName, objectName) - h := make(map[string]string) - - if opts != nil { - headers, query, err := opts.ToObjectCreateParams() - if err != nil { - res.Err = err - return res - } - - for k, v := range headers { - h[k] = v - } - - url += query - } - - hash := md5.New() - bufioReader := bufio.NewReader(io.TeeReader(content, hash)) - io.Copy(ioutil.Discard, bufioReader) - localChecksum := hash.Sum(nil) - - h["ETag"] = fmt.Sprintf("%x", localChecksum) - - _, err := content.Seek(0, 0) - if err != nil { - res.Err = err - return res - } - - ropts := gophercloud.RequestOpts{ - RawBody: content, - MoreHeaders: h, - } - - resp, err := c.Request("PUT", url, ropts) - if err != nil { - res.Err = err - return res - } - if resp != nil { - res.Header = resp.Header - if resp.Header.Get("ETag") == fmt.Sprintf("%x", localChecksum) { - res.Err = err - return res - } - res.Err = fmt.Errorf("Local checksum does not match API ETag header") - } - - return res -} - -// CopyOptsBuilder allows extensions to add additional parameters to the -// Copy request. -type CopyOptsBuilder interface { - ToObjectCopyMap() (map[string]string, error) -} - -// 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"` - ContentType string `h:"Content-Type"` - Destination string `h:"Destination,required"` -} - -// ToObjectCopyMap formats a CopyOpts into a map of headers. -func (opts CopyOpts) ToObjectCopyMap() (map[string]string, error) { - if opts.Destination == "" { - return nil, fmt.Errorf("Required CopyOpts field 'Destination' not set.") - } - h, err := gophercloud.BuildHeaders(opts) - if err != nil { - return nil, err - } - for k, v := range opts.Metadata { - h["X-Object-Meta-"+k] = v - } - return h, nil -} - -// Copy is a function that copies one object to another. -func Copy(c *gophercloud.ServiceClient, containerName, objectName string, opts CopyOptsBuilder) CopyResult { - var res CopyResult - h := c.AuthenticatedHeaders() - - headers, err := opts.ToObjectCopyMap() - if err != nil { - res.Err = err - return res - } - - for k, v := range headers { - h[k] = v - } - - url := copyURL(c, containerName, objectName) - resp, err := c.Request("COPY", url, gophercloud.RequestOpts{ - MoreHeaders: h, - OkCodes: []int{201}, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} - -// DeleteOptsBuilder allows extensions to add additional parameters to the -// Delete request. -type DeleteOptsBuilder interface { - ToObjectDeleteQuery() (string, error) -} - -// DeleteOpts is a structure that holds parameters for deleting an object. -type DeleteOpts struct { - MultipartManifest string `q:"multipart-manifest"` -} - -// ToObjectDeleteQuery formats a DeleteOpts into a query string. -func (opts DeleteOpts) ToObjectDeleteQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// Delete is a function that deletes an object. -func Delete(c *gophercloud.ServiceClient, containerName, objectName string, opts DeleteOptsBuilder) DeleteResult { - var res DeleteResult - url := deleteURL(c, containerName, objectName) - - if opts != nil { - query, err := opts.ToObjectDeleteQuery() - if err != nil { - res.Err = err - return res - } - url += query - } - - resp, err := c.Delete(url, nil) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} - -// GetOptsBuilder allows extensions to add additional parameters to the -// Get request. -type GetOptsBuilder interface { - ToObjectGetQuery() (string, error) -} - -// GetOpts is a structure that holds parameters for getting an object's metadata. -type GetOpts struct { - Expires string `q:"expires"` - Signature string `q:"signature"` -} - -// ToObjectGetQuery formats a GetOpts into a query string. -func (opts GetOpts) ToObjectGetQuery() (string, error) { - q, err := gophercloud.BuildQueryString(opts) - if err != nil { - return "", err - } - return q.String(), nil -} - -// 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 GetOptsBuilder) GetResult { - var res GetResult - url := getURL(c, containerName, objectName) - - if opts != nil { - query, err := opts.ToObjectGetQuery() - if err != nil { - res.Err = err - return res - } - url += query - } - - resp, err := c.Request("HEAD", url, gophercloud.RequestOpts{ - OkCodes: []int{200, 204}, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} - -// UpdateOptsBuilder allows extensions to add additional parameters to the -// Update request. -type UpdateOptsBuilder interface { - ToObjectUpdateMap() (map[string]string, error) -} - -// UpdateOpts is a structure that holds parameters for updating, creating, or deleting an -// object's metadata. -type UpdateOpts struct { - Metadata map[string]string - ContentDisposition string `h:"Content-Disposition"` - ContentEncoding string `h:"Content-Encoding"` - ContentType string `h:"Content-Type"` - DeleteAfter int `h:"X-Delete-After"` - DeleteAt int `h:"X-Delete-At"` - DetectContentType bool `h:"X-Detect-Content-Type"` -} - -// ToObjectUpdateMap formats a UpdateOpts into a map of headers. -func (opts UpdateOpts) ToObjectUpdateMap() (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 - } - return h, nil -} - -// Update is a function that creates, updates, or deletes an object's metadata. -func Update(c *gophercloud.ServiceClient, containerName, objectName string, opts UpdateOptsBuilder) UpdateResult { - var res UpdateResult - h := c.AuthenticatedHeaders() - - if opts != nil { - headers, err := opts.ToObjectUpdateMap() - if err != nil { - res.Err = err - return res - } - - for k, v := range headers { - h[k] = v - } - } - - url := updateURL(c, containerName, objectName) - resp, err := c.Request("POST", url, gophercloud.RequestOpts{ - MoreHeaders: h, - }) - if resp != nil { - res.Header = resp.Header - } - res.Err = err - return res -} - -// HTTPMethod represents an HTTP method string (e.g. "GET"). -type HTTPMethod string - -var ( - // GET represents an HTTP "GET" method. - GET HTTPMethod = "GET" - // POST represents an HTTP "POST" method. - POST HTTPMethod = "POST" -) - -// CreateTempURLOpts are options for creating a temporary URL for an object. -type CreateTempURLOpts struct { - // (REQUIRED) Method is the HTTP method to allow for users of the temp URL. Valid values - // are "GET" and "POST". - Method HTTPMethod - // (REQUIRED) TTL is the number of seconds the temp URL should be active. - TTL int - // (Optional) Split is the string on which to split the object URL. Since only - // the object path is used in the hash, the object URL needs to be parsed. If - // empty, the default OpenStack URL split point will be used ("/v1/"). - Split string -} - -// CreateTempURL is a function for creating a temporary URL for an object. It -// allows users to have "GET" or "POST" access to a particular tenant's object -// for a limited amount of time. -func CreateTempURL(c *gophercloud.ServiceClient, containerName, objectName string, opts CreateTempURLOpts) (string, error) { - if opts.Split == "" { - opts.Split = "/v1/" - } - duration := time.Duration(opts.TTL) * time.Second - expiry := time.Now().Add(duration).Unix() - getHeader, err := accounts.Get(c, nil).Extract() - if err != nil { - return "", err - } - secretKey := []byte(getHeader.TempURLKey) - url := getURL(c, containerName, objectName) - splitPath := strings.Split(url, opts.Split) - baseURL, objectPath := splitPath[0], splitPath[1] - objectPath = opts.Split + objectPath - body := fmt.Sprintf("%s\n%d\n%s", opts.Method, expiry, objectPath) - hash := hmac.New(sha1.New, secretKey) - hash.Write([]byte(body)) - hexsum := fmt.Sprintf("%x", hash.Sum(nil)) - return fmt.Sprintf("%s%s?temp_url_sig=%s&temp_url_expires=%d", baseURL, objectPath, hexsum, expiry), nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/results.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/results.go deleted file mode 100644 index ecb2c54582f..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/results.go +++ /dev/null @@ -1,438 +0,0 @@ -package objects - -import ( - "fmt" - "io" - "io/ioutil" - "strconv" - "strings" - "time" - - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/pagination" - - "github.com/mitchellh/mapstructure" -) - -// Object is a structure that holds information related to a storage object. -type Object struct { - // Bytes is the total number of bytes that comprise the object. - Bytes int64 `json:"bytes" mapstructure:"bytes"` - - // ContentType is the content type of the object. - ContentType string `json:"content_type" mapstructure:"content_type"` - - // Hash represents the MD5 checksum value of the object's content. - Hash string `json:"hash" mapstructure:"hash"` - - // LastModified is the RFC3339Milli time the object was last modified, represented - // as a string. For any given object (obj), this value may be parsed to a time.Time: - // lastModified, err := time.Parse(gophercloud.RFC3339Milli, obj.LastModified) - LastModified string `json:"last_modified" mapstructure:"last_modified"` - - // Name is the unique name for the object. - Name string `json:"name" mapstructure:"name"` -} - -// ObjectPage is a single page of objects that is returned from a call to the -// List function. -type ObjectPage struct { - pagination.MarkerPageBase -} - -// IsEmpty returns true if a ListResult contains no object names. -func (r ObjectPage) IsEmpty() (bool, error) { - names, err := ExtractNames(r) - if err != nil { - return true, err - } - return len(names) == 0, nil -} - -// LastMarker returns the last object name in a ListResult. -func (r ObjectPage) LastMarker() (string, error) { - names, err := ExtractNames(r) - if err != nil { - return "", err - } - if len(names) == 0 { - return "", nil - } - return names[len(names)-1], nil -} - -// ExtractInfo is a function that takes a page of objects and returns their full information. -func ExtractInfo(page pagination.Page) ([]Object, error) { - untyped := page.(ObjectPage).Body.([]interface{}) - results := make([]Object, len(untyped)) - for index, each := range untyped { - object := each.(map[string]interface{}) - err := mapstructure.Decode(object, &results[index]) - if err != nil { - return results, err - } - } - return results, nil -} - -// ExtractNames is a function that takes a page of objects and returns only their names. -func ExtractNames(page pagination.Page) ([]string, error) { - casted := page.(ObjectPage) - ct := casted.Header.Get("Content-Type") - switch { - case strings.HasPrefix(ct, "application/json"): - parsed, err := ExtractInfo(page) - if err != nil { - return nil, err - } - - names := make([]string, 0, len(parsed)) - for _, object := range parsed { - names = append(names, object.Name) - } - - return names, nil - case strings.HasPrefix(ct, "text/plain"): - names := make([]string, 0, 50) - - body := string(page.(ObjectPage).Body.([]uint8)) - for _, name := range strings.Split(body, "\n") { - if len(name) > 0 { - names = append(names, name) - } - } - - return names, nil - case strings.HasPrefix(ct, "text/html"): - return []string{}, nil - default: - return nil, fmt.Errorf("Cannot extract names from response with content-type: [%s]", ct) - } -} - -// DownloadHeader represents the headers returned in the response from a Download request. -type DownloadHeader struct { - AcceptRanges string `mapstructure:"Accept-Ranges"` - ContentDisposition string `mapstructure:"Content-Disposition"` - ContentEncoding string `mapstructure:"Content-Encoding"` - ContentLength int64 `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - DeleteAt time.Time `mapstructure:"-"` - ETag string `mapstructure:"Etag"` - LastModified time.Time `mapstructure:"-"` - ObjectManifest string `mapstructure:"X-Object-Manifest"` - StaticLargeObject bool `mapstructure:"X-Static-Large-Object"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// DownloadResult is a *http.Response that is returned from a call to the Download function. -type DownloadResult struct { - gophercloud.HeaderResult - Body io.ReadCloser -} - -// Extract will return a struct of headers returned from a call to Download. To obtain -// a map of headers, call the ExtractHeader method on the DownloadResult. -func (dr DownloadResult) Extract() (DownloadHeader, error) { - var dh DownloadHeader - if dr.Err != nil { - return dh, dr.Err - } - - if err := gophercloud.DecodeHeader(dr.Header, &dh); err != nil { - return dh, err - } - - if date, ok := dr.Header["Date"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, date[0]) - if err != nil { - return dh, err - } - dh.Date = t - } - - if date, ok := dr.Header["Last-Modified"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, date[0]) - if err != nil { - return dh, err - } - dh.LastModified = t - } - - if date, ok := dr.Header["X-Delete-At"]; ok && len(date) > 0 { - unix, err := strconv.ParseInt(date[0], 10, 64) - if err != nil { - return dh, err - } - dh.DeleteAt = time.Unix(unix, 0) - } - - return dh, nil -} - -// ExtractContent is a function that takes a DownloadResult's io.Reader body -// and reads all available data into a slice of bytes. Please be aware that due -// the nature of io.Reader is forward-only - meaning that it can only be read -// once and not rewound. You can recreate a reader from the output of this -// function by using bytes.NewReader(downloadBytes) -func (dr DownloadResult) ExtractContent() ([]byte, error) { - if dr.Err != nil { - return nil, dr.Err - } - body, err := ioutil.ReadAll(dr.Body) - if err != nil { - return nil, err - } - dr.Body.Close() - return body, nil -} - -// GetHeader represents the headers returned in the response from a Get request. -type GetHeader struct { - ContentDisposition string `mapstructure:"Content-Disposition"` - ContentEncoding string `mapstructure:"Content-Encoding"` - ContentLength int64 `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - DeleteAt time.Time `mapstructure:"-"` - ETag string `mapstructure:"Etag"` - LastModified time.Time `mapstructure:"-"` - ObjectManifest string `mapstructure:"X-Object-Manifest"` - StaticLargeObject bool `mapstructure:"X-Static-Large-Object"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// GetResult is a *http.Response that is returned from a call to the Get function. -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 - } - - if date, ok := gr.Header["Last-Modified"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, gr.Header["Last-Modified"][0]) - if err != nil { - return gh, err - } - gh.LastModified = t - } - - if date, ok := gr.Header["X-Delete-At"]; ok && len(date) > 0 { - unix, err := strconv.ParseInt(date[0], 10, 64) - if err != nil { - return gh, err - } - gh.DeleteAt = time.Unix(unix, 0) - } - - return gh, nil -} - -// ExtractMetadata is a function that takes a GetResult (of type *http.Response) -// and returns the custom metadata associated with the object. -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-Object-Meta-") { - key := strings.TrimPrefix(k, "X-Object-Meta-") - metadata[key] = v[0] - } - } - return metadata, nil -} - -// CreateHeader represents the headers returned in the response from a Create request. -type CreateHeader struct { - ContentLength int64 `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - ETag string `mapstructure:"Etag"` - LastModified time.Time `mapstructure:"-"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// CreateResult represents the result of a create operation. -type CreateResult struct { - gophercloud.HeaderResult -} - -// Extract will return a struct of headers returned from a call to Create. To obtain -// a map of headers, call the ExtractHeader method on the CreateResult. -func (cr CreateResult) Extract() (CreateHeader, error) { - var ch CreateHeader - if cr.Err != nil { - return ch, cr.Err - } - - if err := gophercloud.DecodeHeader(cr.Header, &ch); err != nil { - return ch, err - } - - if date, ok := cr.Header["Date"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, cr.Header["Date"][0]) - if err != nil { - return ch, err - } - ch.Date = t - } - - if date, ok := cr.Header["Last-Modified"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, cr.Header["Last-Modified"][0]) - if err != nil { - return ch, err - } - ch.LastModified = t - } - - return ch, nil -} - -// UpdateHeader represents the headers returned in the response from a Update request. -type UpdateHeader struct { - ContentLength int64 `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. -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 -} - -// DeleteHeader represents the headers returned in the response from a Delete request. -type DeleteHeader struct { - ContentLength int64 `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - Date time.Time `mapstructure:"-"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// DeleteResult represents the result of a delete operation. -type DeleteResult struct { - gophercloud.HeaderResult -} - -// Extract will return a struct of headers returned from a call to Delete. To obtain -// a map of headers, call the ExtractHeader method on the DeleteResult. -func (dr DeleteResult) Extract() (DeleteHeader, error) { - var dh DeleteHeader - if dr.Err != nil { - return dh, dr.Err - } - - if err := gophercloud.DecodeHeader(dr.Header, &dh); err != nil { - return dh, err - } - - if date, ok := dr.Header["Date"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, dr.Header["Date"][0]) - if err != nil { - return dh, err - } - dh.Date = t - } - - return dh, nil -} - -// CopyHeader represents the headers returned in the response from a Copy request. -type CopyHeader struct { - ContentLength int64 `mapstructure:"Content-Length"` - ContentType string `mapstructure:"Content-Type"` - CopiedFrom string `mapstructure:"X-Copied-From"` - CopiedFromLastModified time.Time `mapstructure:"-"` - Date time.Time `mapstructure:"-"` - ETag string `mapstructure:"Etag"` - LastModified time.Time `mapstructure:"-"` - TransID string `mapstructure:"X-Trans-Id"` -} - -// CopyResult represents the result of a copy operation. -type CopyResult struct { - gophercloud.HeaderResult -} - -// Extract will return a struct of headers returned from a call to Copy. To obtain -// a map of headers, call the ExtractHeader method on the CopyResult. -func (cr CopyResult) Extract() (CopyHeader, error) { - var ch CopyHeader - if cr.Err != nil { - return ch, cr.Err - } - - if err := gophercloud.DecodeHeader(cr.Header, &ch); err != nil { - return ch, err - } - - if date, ok := cr.Header["Date"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, cr.Header["Date"][0]) - if err != nil { - return ch, err - } - ch.Date = t - } - - if date, ok := cr.Header["Last-Modified"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, cr.Header["Last-Modified"][0]) - if err != nil { - return ch, err - } - ch.LastModified = t - } - - if date, ok := cr.Header["X-Copied-From-Last-Modified"]; ok && len(date) > 0 { - t, err := time.Parse(time.RFC1123, cr.Header["X-Copied-From-Last-Modified"][0]) - if err != nil { - return ch, err - } - ch.CopiedFromLastModified = t - } - - return ch, nil -} diff --git a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/urls.go b/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/urls.go deleted file mode 100644 index d2ec62cff22..00000000000 --- a/vendor/github.com/rackspace/gophercloud/openstack/objectstorage/v1/objects/urls.go +++ /dev/null @@ -1,33 +0,0 @@ -package objects - -import ( - "github.com/rackspace/gophercloud" -) - -func listURL(c *gophercloud.ServiceClient, container string) string { - return c.ServiceURL(container) -} - -func copyURL(c *gophercloud.ServiceClient, container, object string) string { - return c.ServiceURL(container, object) -} - -func createURL(c *gophercloud.ServiceClient, container, object string) string { - return copyURL(c, container, object) -} - -func getURL(c *gophercloud.ServiceClient, container, object string) string { - return copyURL(c, container, object) -} - -func deleteURL(c *gophercloud.ServiceClient, container, object string) string { - return copyURL(c, container, object) -} - -func downloadURL(c *gophercloud.ServiceClient, container, object string) string { - return copyURL(c, container, object) -} - -func updateURL(c *gophercloud.ServiceClient, container, object string) string { - return copyURL(c, container, object) -} 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 f2db622d1fc..00000000000 --- 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 f6454c86097..00000000000 --- 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 0700ab0afb8..00000000000 --- 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 55d6e0e7a43..00000000000 --- 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 183e8dfa76d..00000000000 --- 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 20ea09b4425..00000000000 --- 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 9e03e5cc85b..00000000000 --- 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 683a434a053..00000000000 --- 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 2c873d02358..00000000000 --- 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 51cdd97473c..00000000000 --- 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 235787a5145..00000000000 --- 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 70c6b97e80a..00000000000 --- 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 cf9e240982d..00000000000 --- 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 8b5eceb1704..00000000000 --- 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 e4f8b08dcc7..00000000000 --- 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 952dc54d130..00000000000 --- 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 fcb8d8a2f82..00000000000 --- 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 6ddc7660dd7..00000000000 --- 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 ef078d9c9b4..00000000000 --- 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 19231b5137e..00000000000 --- 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 abaff205729..00000000000 --- 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 83f5dec8ddc..00000000000 --- 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 1fc484d677f..00000000000 --- 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 432bc8e0cc5..00000000000 --- 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 234ce498e7b..00000000000 --- 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 3dd2bb32ead..00000000000 --- 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 7b476a9c392..00000000000 --- 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 5af0bd62a11..00000000000 --- 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 fa9b3016f51..00000000000 --- 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 c0cea35752d..00000000000 --- 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 4e9ba5a4c61..00000000000 --- 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 c30b7ca1afe..00000000000 --- 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/blockstorage/v1/snapshots/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/snapshots/delegate.go deleted file mode 100644 index 1cd1b6e30cc..00000000000 --- 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 ad6064f2af1..00000000000 --- 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 c81644c5ddd..00000000000 --- 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/volumetypes/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/blockstorage/v1/volumetypes/delegate.go deleted file mode 100644 index c96b3e4a357..00000000000 --- 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 70122b77c4a..00000000000 --- 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 39c8d6f7fac..00000000000 --- 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 5af7e077844..00000000000 --- 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 5582306a8e5..00000000000 --- 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 7152fa23af3..00000000000 --- 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 4ad966eac8d..00000000000 --- 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 07c93a8dcda..00000000000 --- 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 46b3d50a81f..00000000000 --- 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 e3f14599773..00000000000 --- 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 ee6e2a54fc9..00000000000 --- 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/compute/v2/bootfromvolume/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/bootfromvolume/delegate.go deleted file mode 100644 index 2580459f077..00000000000 --- 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 081ea478cd8..00000000000 --- 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 278229ab97b..00000000000 --- 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 957dccfd7dd..00000000000 --- 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 af444a766d3..00000000000 --- 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 f4e2c3dac42..00000000000 --- 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 18e1f315af9..00000000000 --- 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 cfae8067127..00000000000 --- 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 ccfbdc6a1e4..00000000000 --- 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 3e53525dc7c..00000000000 --- 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 31713752eae..00000000000 --- 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 8e5c77382d3..00000000000 --- 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 cebbffd36a6..00000000000 --- 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 eb6a76c008c..00000000000 --- 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 19a21aa90da..00000000000 --- 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/virtualinterfaces/requests.go b/vendor/github.com/rackspace/gophercloud/rackspace/compute/v2/virtualinterfaces/requests.go deleted file mode 100644 index 1ff7c5ae55f..00000000000 --- 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 26fa7f31ce0..00000000000 --- 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 9e5693e8490..00000000000 --- 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/db/v1/backups/doc.go b/vendor/github.com/rackspace/gophercloud/rackspace/db/v1/backups/doc.go deleted file mode 100644 index 664eeadb843..00000000000 --- 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 45c2376d6fc..00000000000 --- 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 9170d786551..00000000000 --- 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 04faf3227d0..00000000000 --- 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 553444e8852..00000000000 --- 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 d8cb48ac598..00000000000 --- 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 48c51d60d1d..00000000000 --- 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 d8a2233bc4e..00000000000 --- 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 56552d1874c..00000000000 --- 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 1a178b61f4c..00000000000 --- 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 18cbec72e7c..00000000000 --- 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 573496d3827..00000000000 --- 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 f36997a03c5..00000000000 --- 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 689b81eaca6..00000000000 --- 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 922a4e66700..00000000000 --- 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 f2656fe3b76..00000000000 --- 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 0c8ad63363c..00000000000 --- 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 c5ff37aee1a..00000000000 --- 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 f4df692a429..00000000000 --- 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 cdcc9c716f2..00000000000 --- 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 5955f4cdef9..00000000000 --- 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 8298c46056b..00000000000 --- 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 84f2eb32742..00000000000 --- 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 5314e854ff1..00000000000 --- 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 74e47ab23b2..00000000000 --- 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 85b3a7aaaad..00000000000 --- 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 bac8788ff94..00000000000 --- 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 fc547cde5f4..00000000000 --- 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 b02a95b534c..00000000000 --- 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 a6ee8515ceb..00000000000 --- 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 5f22d0f6424..00000000000 --- 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 6cdd0cfbdcf..00000000000 --- 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 c1825c21dcf..00000000000 --- 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/users/delegate.go b/vendor/github.com/rackspace/gophercloud/rackspace/identity/v2/users/delegate.go deleted file mode 100644 index 6135bec101a..00000000000 --- 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 973f39ea8c9..00000000000 --- 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 6936ecba84e..00000000000 --- 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 bc1aaefb022..00000000000 --- 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 42325fe83d5..00000000000 --- 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 e3c941c81ba..00000000000 --- 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 d4ce7c01f44..00000000000 --- 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 9ea5ea2f4b7..00000000000 --- 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 e373fa1d809..00000000000 --- 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 05f0032859b..00000000000 --- 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 6325310dbbb..00000000000 --- 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 46f5f02a43a..00000000000 --- 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 98f3962d77e..00000000000 --- 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 471a86b0a7e..00000000000 --- 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 2c5be75ae42..00000000000 --- 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 a565abced54..00000000000 --- 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 d4ba27653ca..00000000000 --- 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 eec556f343c..00000000000 --- 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 0a1e6df5f49..00000000000 --- 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 49c431894a7..00000000000 --- 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 8899fc5e975..00000000000 --- 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 9da376f832e..00000000000 --- 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 57835dc4b5d..00000000000 --- 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 2cefee26449..00000000000 --- 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 dcec0a87e2b..00000000000 --- 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 077ef047019..00000000000 --- 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 a93d766cd92..00000000000 --- 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 fe90e722cbd..00000000000 --- 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 c4a896d9057..00000000000 --- 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 6a2c174ae93..00000000000 --- 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 5a52962d49a..00000000000 --- 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 bb53ef89602..00000000000 --- 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 ead9fcd37eb..00000000000 --- 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 aa814b35834..00000000000 --- 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 1ed605d3629..00000000000 --- 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 f3e49fa6884..00000000000 --- 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 0446b97a14f..00000000000 --- 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 db93c6f3f4f..00000000000 --- 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 b77f0ac1c79..00000000000 --- 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 5c3846d44d6..00000000000 --- 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 158759f7fa1..00000000000 --- 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 2bc924f293b..00000000000 --- 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 678b2aff797..00000000000 --- 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 28f063a0f78..00000000000 --- 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 129cd63aee9..00000000000 --- 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 dcb0855dba3..00000000000 --- 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 95728d18558..00000000000 --- 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 31f744ccd7a..00000000000 --- 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 1e9a23a05a1..00000000000 --- 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 23b4b318e2b..00000000000 --- 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 a7fb7bb15fc..00000000000 --- 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 94739308fa6..00000000000 --- 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 293a93088a7..00000000000 --- 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 9c89e22b21b..00000000000 --- 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 0aeec155b77..00000000000 --- 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 fddc125ac63..00000000000 --- 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 2e112033bec..00000000000 --- 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 89adb83965d..00000000000 --- 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 7b0930eeea6..00000000000 --- 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 6acebb0aad2..00000000000 --- 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 cb0ad3096c3..00000000000 --- 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 541249a9273..00000000000 --- 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 e9d2ff1d6f3..00000000000 --- 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 90cd5c97ffc..00000000000 --- 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 540e0cd298a..00000000000 --- 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 77ed0025743..00000000000 --- 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 d132a07382a..00000000000 --- 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 94c820ba7bd..00000000000 --- 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 781984bee25..00000000000 --- 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 c834e5c7d39..00000000000 --- 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 183e8dfa76d..00000000000 --- 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 08675deac77..00000000000 --- 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 dfd6ef6605e..00000000000 --- 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 cb7be28b78a..00000000000 --- 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 e4f8b08dcc7..00000000000 --- 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 f7e387f8f79..00000000000 --- 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 19231b5137e..00000000000 --- 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 c9afeb156f6..00000000000 --- 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 3b5d46e1c9e..00000000000 --- 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 5af0bd62a11..00000000000 --- 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 58843030aed..00000000000 --- 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 f554a0d75bd..00000000000 --- 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 bd6b098dadc..00000000000 --- 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 3a8279e1091..00000000000 --- 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 f4319b8ff37..00000000000 --- 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 c300c56c1e9..00000000000 --- 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 e5e914b1e2b..00000000000 --- 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 c238239f61e..00000000000 --- 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 1164260109e..00000000000 --- 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 132cf770a0f..00000000000 --- 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 6f310be4e81..00000000000 --- 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 f9c89f4dfdd..00000000000 --- 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 6bae6e8f14f..00000000000 --- 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 1cb389e7dce..00000000000 --- 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 1e03dff8ab3..00000000000 --- 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 d3440a902c0..00000000000 --- 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 d54355d7557..00000000000 --- 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/russross/blackfriday/upskirtref/Amps and angle encoding.html b/vendor/github.com/russross/blackfriday/upskirtref/Amps and angle encoding.html deleted file mode 100644 index 483f8ffa166..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Amps and angle encoding.html +++ /dev/null @@ -1,17 +0,0 @@ -

AT&T has an ampersand in their name.

- -

AT&T is another way to write it.

- -

This & that.

- -

4 < 5.

- -

6 > 5.

- -

Here's a link with an ampersand in the URL.

- -

Here's a link with an amersand in the link text: AT&T.

- -

Here's an inline link.

- -

Here's an inline link.

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Amps and angle encoding.text b/vendor/github.com/russross/blackfriday/upskirtref/Amps and angle encoding.text deleted file mode 100644 index 0e9527f9311..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Amps and angle encoding.text +++ /dev/null @@ -1,21 +0,0 @@ -AT&T has an ampersand in their name. - -AT&T is another way to write it. - -This & that. - -4 < 5. - -6 > 5. - -Here's a [link] [1] with an ampersand in the URL. - -Here's a link with an amersand in the link text: [AT&T] [2]. - -Here's an inline [link](/script?foo=1&bar=2). - -Here's an inline [link](). - - -[1]: http://example.com/?foo=1&bar=2 -[2]: http://att.com/ "AT&T" \ No newline at end of file diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Auto links.html b/vendor/github.com/russross/blackfriday/upskirtref/Auto links.html deleted file mode 100644 index b1791e7f946..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Auto links.html +++ /dev/null @@ -1,18 +0,0 @@ -

Link: http://example.com/.

- -

With an ampersand: http://example.com/?foo=1&bar=2

- - - -
-

Blockquoted: http://example.com/

-
- -

Auto-links should not occur here: <http://example.com/>

- -
or here: <http://example.com/>
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Auto links.text b/vendor/github.com/russross/blackfriday/upskirtref/Auto links.text deleted file mode 100644 index abbc48869de..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Auto links.text +++ /dev/null @@ -1,13 +0,0 @@ -Link: . - -With an ampersand: - -* In a list? -* -* It should. - -> Blockquoted: - -Auto-links should not occur here: `` - - or here: \ No newline at end of file diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Backslash escapes.html b/vendor/github.com/russross/blackfriday/upskirtref/Backslash escapes.html deleted file mode 100644 index a73c998f689..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Backslash escapes.html +++ /dev/null @@ -1,123 +0,0 @@ -

These should all get escaped:

- -

Backslash: \

- -

Backtick: `

- -

Asterisk: *

- -

Underscore: _

- -

Left brace: {

- -

Right brace: }

- -

Left bracket: [

- -

Right bracket: ]

- -

Left paren: (

- -

Right paren: )

- -

Greater-than: >

- -

Hash: #

- -

Period: .

- -

Bang: !

- -

Plus: +

- -

Minus: -

- -

Tilde: ~

- -

These should not, because they occur within a code block:

- -
Backslash: \\
-
-Backtick: \`
-
-Asterisk: \*
-
-Underscore: \_
-
-Left brace: \{
-
-Right brace: \}
-
-Left bracket: \[
-
-Right bracket: \]
-
-Left paren: \(
-
-Right paren: \)
-
-Greater-than: \>
-
-Hash: \#
-
-Period: \.
-
-Bang: \!
-
-Plus: \+
-
-Minus: \-
-
-Tilde: \~
-
- -

Nor should these, which occur in code spans:

- -

Backslash: \\

- -

Backtick: \`

- -

Asterisk: \*

- -

Underscore: \_

- -

Left brace: \{

- -

Right brace: \}

- -

Left bracket: \[

- -

Right bracket: \]

- -

Left paren: \(

- -

Right paren: \)

- -

Greater-than: \>

- -

Hash: \#

- -

Period: \.

- -

Bang: \!

- -

Plus: \+

- -

Minus: \-

- -

Tilde: \~

- -

These should get escaped, even though they're matching pairs for -other Markdown constructs:

- -

*asterisks*

- -

_underscores_

- -

`backticks`

- -

This is a code span with a literal backslash-backtick sequence: \`

- -

This is a tag with unescaped backticks bar.

- -

This is a tag with backslashes bar.

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Backslash escapes.text b/vendor/github.com/russross/blackfriday/upskirtref/Backslash escapes.text deleted file mode 100644 index 04c20bd3bef..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Backslash escapes.text +++ /dev/null @@ -1,126 +0,0 @@ -These should all get escaped: - -Backslash: \\ - -Backtick: \` - -Asterisk: \* - -Underscore: \_ - -Left brace: \{ - -Right brace: \} - -Left bracket: \[ - -Right bracket: \] - -Left paren: \( - -Right paren: \) - -Greater-than: \> - -Hash: \# - -Period: \. - -Bang: \! - -Plus: \+ - -Minus: \- - -Tilde: \~ - - - -These should not, because they occur within a code block: - - Backslash: \\ - - Backtick: \` - - Asterisk: \* - - Underscore: \_ - - Left brace: \{ - - Right brace: \} - - Left bracket: \[ - - Right bracket: \] - - Left paren: \( - - Right paren: \) - - Greater-than: \> - - Hash: \# - - Period: \. - - Bang: \! - - Plus: \+ - - Minus: \- - - Tilde: \~ - - -Nor should these, which occur in code spans: - -Backslash: `\\` - -Backtick: `` \` `` - -Asterisk: `\*` - -Underscore: `\_` - -Left brace: `\{` - -Right brace: `\}` - -Left bracket: `\[` - -Right bracket: `\]` - -Left paren: `\(` - -Right paren: `\)` - -Greater-than: `\>` - -Hash: `\#` - -Period: `\.` - -Bang: `\!` - -Plus: `\+` - -Minus: `\-` - -Tilde: `\~` - - -These should get escaped, even though they're matching pairs for -other Markdown constructs: - -\*asterisks\* - -\_underscores\_ - -\`backticks\` - -This is a code span with a literal backslash-backtick sequence: `` \` `` - -This is a tag with unescaped backticks bar. - -This is a tag with backslashes bar. diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Blockquotes with code blocks.html b/vendor/github.com/russross/blackfriday/upskirtref/Blockquotes with code blocks.html deleted file mode 100644 index 360fa9b14c5..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Blockquotes with code blocks.html +++ /dev/null @@ -1,15 +0,0 @@ -
-

Example:

- -
sub status {
-    print "working";
-}
-
- -

Or:

- -
sub status {
-    return "working";
-}
-
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Blockquotes with code blocks.text b/vendor/github.com/russross/blackfriday/upskirtref/Blockquotes with code blocks.text deleted file mode 100644 index c31d171049d..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Blockquotes with code blocks.text +++ /dev/null @@ -1,11 +0,0 @@ -> Example: -> -> sub status { -> print "working"; -> } -> -> Or: -> -> sub status { -> return "working"; -> } diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Code Blocks.html b/vendor/github.com/russross/blackfriday/upskirtref/Code Blocks.html deleted file mode 100644 index 32703f5cb48..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Code Blocks.html +++ /dev/null @@ -1,18 +0,0 @@ -
code block on the first line
-
- -

Regular text.

- -
code block indented by spaces
-
- -

Regular text.

- -
the lines in this block  
-all contain trailing spaces  
-
- -

Regular Text.

- -
code block on the last line
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Code Blocks.text b/vendor/github.com/russross/blackfriday/upskirtref/Code Blocks.text deleted file mode 100644 index b54b09285a7..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Code Blocks.text +++ /dev/null @@ -1,14 +0,0 @@ - code block on the first line - -Regular text. - - code block indented by spaces - -Regular text. - - the lines in this block - all contain trailing spaces - -Regular Text. - - code block on the last line \ No newline at end of file diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Code Spans.html b/vendor/github.com/russross/blackfriday/upskirtref/Code Spans.html deleted file mode 100644 index ef85f95e7a8..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Code Spans.html +++ /dev/null @@ -1,5 +0,0 @@ -

<test a=" content of attribute ">

- -

Fix for backticks within HTML tag: like this

- -

Here's how you put `backticks` in a code span.

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Code Spans.text b/vendor/github.com/russross/blackfriday/upskirtref/Code Spans.text deleted file mode 100644 index 750a1973df9..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Code Spans.text +++ /dev/null @@ -1,6 +0,0 @@ -`` - -Fix for backticks within HTML tag: like this - -Here's how you put `` `backticks` `` in a code span. - diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines no empty line before block.html b/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines no empty line before block.html deleted file mode 100644 index fc253194c63..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines no empty line before block.html +++ /dev/null @@ -1,14 +0,0 @@ -

In Markdown 1.0.0 and earlier. Version

- -
    -
  1. This line turns into a list item. -Because a hard-wrapped line in the -middle of a paragraph looked like a -list item.
  2. -
- -

Here's one with a bullet.

- -
    -
  • criminey.
  • -
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines no empty line before block.text b/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines no empty line before block.text deleted file mode 100644 index f8a5b27bf41..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines no empty line before block.text +++ /dev/null @@ -1,8 +0,0 @@ -In Markdown 1.0.0 and earlier. Version -8. This line turns into a list item. -Because a hard-wrapped line in the -middle of a paragraph looked like a -list item. - -Here's one with a bullet. -* criminey. diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines.html b/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines.html deleted file mode 100644 index e21ac79a2e0..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines.html +++ /dev/null @@ -1,8 +0,0 @@ -

In Markdown 1.0.0 and earlier. Version -8. This line turns into a list item. -Because a hard-wrapped line in the -middle of a paragraph looked like a -list item.

- -

Here's one with a bullet. -* criminey.

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines.text b/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines.text deleted file mode 100644 index f8a5b27bf41..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Hard-wrapped paragraphs with list-like lines.text +++ /dev/null @@ -1,8 +0,0 @@ -In Markdown 1.0.0 and earlier. Version -8. This line turns into a list item. -Because a hard-wrapped line in the -middle of a paragraph looked like a -list item. - -Here's one with a bullet. -* criminey. diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Horizontal rules.html b/vendor/github.com/russross/blackfriday/upskirtref/Horizontal rules.html deleted file mode 100644 index e60d4ba2534..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Horizontal rules.html +++ /dev/null @@ -1,71 +0,0 @@ -

Dashes:

- -
- -
- -
- -
- -
---
-
- -
- -
- -
- -
- -
- - -
-
- -

Asterisks:

- -
- -
- -
- -
- -
***
-
- -
- -
- -
- -
- -
* * *
-
- -

Underscores:

- -
- -
- -
- -
- -
___
-
- -
- -
- -
- -
- -
_ _ _
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Horizontal rules.text b/vendor/github.com/russross/blackfriday/upskirtref/Horizontal rules.text deleted file mode 100644 index 1594bda27b4..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Horizontal rules.text +++ /dev/null @@ -1,67 +0,0 @@ -Dashes: - ---- - - --- - - --- - - --- - - --- - -- - - - - - - - - - - - - - - - - - - - - - - - - -Asterisks: - -*** - - *** - - *** - - *** - - *** - -* * * - - * * * - - * * * - - * * * - - * * * - - -Underscores: - -___ - - ___ - - ___ - - ___ - - ___ - -_ _ _ - - _ _ _ - - _ _ _ - - _ _ _ - - _ _ _ diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Advanced).html b/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Advanced).html deleted file mode 100644 index 3af9cafb1a6..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Advanced).html +++ /dev/null @@ -1,15 +0,0 @@ -

Simple block on one line:

- -
foo
- -

And nested without indentation:

- -
-
-
-foo -
-
-
-
bar
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Advanced).text b/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Advanced).text deleted file mode 100644 index 86b7206d2a1..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Advanced).text +++ /dev/null @@ -1,15 +0,0 @@ -Simple block on one line: - -
foo
- -And nested without indentation: - -
-
-
-foo -
-
-
-
bar
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Simple).html b/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Simple).html deleted file mode 100644 index 6bf78f8fc1b..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Simple).html +++ /dev/null @@ -1,72 +0,0 @@ -

Here's a simple block:

- -
- foo -
- -

This should be a code block, though:

- -
<div>
-    foo
-</div>
-
- -

As should this:

- -
<div>foo</div>
-
- -

Now, nested:

- -
-
-
- foo -
-
-
- -

This should just be an HTML comment:

- - - -

Multiline:

- - - -

Code block:

- -
<!-- Comment -->
-
- -

Just plain comment, with trailing spaces on the line:

- - - -

Code:

- -
<hr />
-
- -

Hr's:

- -
- -
- -
- -
- -
- -
- -
- -
- -
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Simple).text b/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Simple).text deleted file mode 100644 index 14aa2dc272d..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML (Simple).text +++ /dev/null @@ -1,69 +0,0 @@ -Here's a simple block: - -
- foo -
- -This should be a code block, though: - -
- foo -
- -As should this: - -
foo
- -Now, nested: - -
-
-
- foo -
-
-
- -This should just be an HTML comment: - - - -Multiline: - - - -Code block: - - - -Just plain comment, with trailing spaces on the line: - - - -Code: - -
- -Hr's: - -
- -
- -
- -
- -
- -
- -
- -
- -
- diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML comments.html b/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML comments.html deleted file mode 100644 index 3f167a1610e..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML comments.html +++ /dev/null @@ -1,13 +0,0 @@ -

Paragraph one.

- - - - - -

Paragraph two.

- - - -

The end.

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML comments.text b/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML comments.text deleted file mode 100644 index 41d830d0385..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Inline HTML comments.text +++ /dev/null @@ -1,13 +0,0 @@ -Paragraph one. - - - - - -Paragraph two. - - - -The end. diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Links, inline style.html b/vendor/github.com/russross/blackfriday/upskirtref/Links, inline style.html deleted file mode 100644 index 5802f2deb4a..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Links, inline style.html +++ /dev/null @@ -1,11 +0,0 @@ -

Just a URL.

- -

URL and title.

- -

URL and title.

- -

URL and title.

- -

URL and title.

- -

[Empty]().

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Links, inline style.text b/vendor/github.com/russross/blackfriday/upskirtref/Links, inline style.text deleted file mode 100644 index 09017a90c70..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Links, inline style.text +++ /dev/null @@ -1,12 +0,0 @@ -Just a [URL](/url/). - -[URL and title](/url/ "title"). - -[URL and title](/url/ "title preceded by two spaces"). - -[URL and title](/url/ "title preceded by a tab"). - -[URL and title](/url/ "title has spaces afterward" ). - - -[Empty](). diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Links, reference style.html b/vendor/github.com/russross/blackfriday/upskirtref/Links, reference style.html deleted file mode 100644 index bebefdee22e..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Links, reference style.html +++ /dev/null @@ -1,52 +0,0 @@ -

Foo bar.

- -

Foo bar.

- -

Foo bar.

- -

With embedded [brackets].

- -

Indented once.

- -

Indented twice.

- -

Indented thrice.

- -

Indented [four][] times.

- -
[four]: /url
-
- -
- -

this should work

- -

So should this.

- -

And this.

- -

And this.

- -

And this.

- -

But not [that] [].

- -

Nor [that][].

- -

Nor [that].

- -

[Something in brackets like this should work]

- -

[Same with this.]

- -

In this case, this points to something else.

- -

Backslashing should suppress [this] and [this].

- -
- -

Here's one where the link -breaks across lines.

- -

Here's another where the link -breaks across lines, but with a line-ending space.

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Links, reference style.text b/vendor/github.com/russross/blackfriday/upskirtref/Links, reference style.text deleted file mode 100644 index 341ec88e3d0..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Links, reference style.text +++ /dev/null @@ -1,71 +0,0 @@ -Foo [bar] [1]. - -Foo [bar][1]. - -Foo [bar] -[1]. - -[1]: /url/ "Title" - - -With [embedded [brackets]] [b]. - - -Indented [once][]. - -Indented [twice][]. - -Indented [thrice][]. - -Indented [four][] times. - - [once]: /url - - [twice]: /url - - [thrice]: /url - - [four]: /url - - -[b]: /url/ - -* * * - -[this] [this] should work - -So should [this][this]. - -And [this] []. - -And [this][]. - -And [this]. - -But not [that] []. - -Nor [that][]. - -Nor [that]. - -[Something in brackets like [this][] should work] - -[Same with [this].] - -In this case, [this](/somethingelse/) points to something else. - -Backslashing should suppress \[this] and [this\]. - -[this]: foo - - -* * * - -Here's one where the [link -breaks] across lines. - -Here's another where the [link -breaks] across lines, but with a line-ending space. - - -[link breaks]: /url/ diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Links, shortcut references.html b/vendor/github.com/russross/blackfriday/upskirtref/Links, shortcut references.html deleted file mode 100644 index 0b5e1d64e7f..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Links, shortcut references.html +++ /dev/null @@ -1,9 +0,0 @@ -

This is the simple case.

- -

This one has a line -break.

- -

This one has a line -break with a line-ending space.

- -

this and the other

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Links, shortcut references.text b/vendor/github.com/russross/blackfriday/upskirtref/Links, shortcut references.text deleted file mode 100644 index 8c44c98feed..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Links, shortcut references.text +++ /dev/null @@ -1,20 +0,0 @@ -This is the [simple case]. - -[simple case]: /simple - - - -This one has a [line -break]. - -This one has a [line -break] with a line-ending space. - -[line break]: /foo - - -[this] [that] and the [other] - -[this]: /this -[that]: /that -[other]: /other diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Literal quotes in titles.html b/vendor/github.com/russross/blackfriday/upskirtref/Literal quotes in titles.html deleted file mode 100644 index 611c1ac61f0..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Literal quotes in titles.html +++ /dev/null @@ -1,3 +0,0 @@ -

Foo bar.

- -

Foo bar.

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Literal quotes in titles.text b/vendor/github.com/russross/blackfriday/upskirtref/Literal quotes in titles.text deleted file mode 100644 index 29d0e4235b2..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Literal quotes in titles.text +++ /dev/null @@ -1,7 +0,0 @@ -Foo [bar][]. - -Foo [bar](/url/ "Title with "quotes" inside"). - - - [bar]: /url/ "Title with "quotes" inside" - diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Basics.html b/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Basics.html deleted file mode 100644 index ea3a61c39bb..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Basics.html +++ /dev/null @@ -1,314 +0,0 @@ -

Markdown: Basics

- - - -

Getting the Gist of Markdown's Formatting Syntax

- -

This page offers a brief overview of what it's like to use Markdown. -The syntax page provides complete, detailed documentation for -every feature, but Markdown should be very easy to pick up simply by -looking at a few examples of it in action. The examples on this page -are written in a before/after style, showing example syntax and the -HTML output produced by Markdown.

- -

It's also helpful to simply try Markdown out; the Dingus is a -web application that allows you type your own Markdown-formatted text -and translate it to XHTML.

- -

Note: This document is itself written using Markdown; you -can see the source for it by adding '.text' to the URL.

- -

Paragraphs, Headers, Blockquotes

- -

A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs.

- -

Markdown offers two styles of headers: Setext and atx. -Setext-style headers for <h1> and <h2> are created by -"underlining" with equal signs (=) and hyphens (-), respectively. -To create an atx-style header, you put 1-6 hash marks (#) at the -beginning of the line -- the number of hashes equals the resulting -HTML header level.

- -

Blockquotes are indicated using email-style '>' angle brackets.

- -

Markdown:

- -
A First Level Header
-====================
-
-A Second Level Header
----------------------
-
-Now is the time for all good men to come to
-the aid of their country. This is just a
-regular paragraph.
-
-The quick brown fox jumped over the lazy
-dog's back.
-
-### Header 3
-
-> This is a blockquote.
-> 
-> This is the second paragraph in the blockquote.
->
-> ## This is an H2 in a blockquote
-
- -

Output:

- -
<h1>A First Level Header</h1>
-
-<h2>A Second Level Header</h2>
-
-<p>Now is the time for all good men to come to
-the aid of their country. This is just a
-regular paragraph.</p>
-
-<p>The quick brown fox jumped over the lazy
-dog's back.</p>
-
-<h3>Header 3</h3>
-
-<blockquote>
-    <p>This is a blockquote.</p>
-
-    <p>This is the second paragraph in the blockquote.</p>
-
-    <h2>This is an H2 in a blockquote</h2>
-</blockquote>
-
- -

Phrase Emphasis

- -

Markdown uses asterisks and underscores to indicate spans of emphasis.

- -

Markdown:

- -
Some of these words *are emphasized*.
-Some of these words _are emphasized also_.
-
-Use two asterisks for **strong emphasis**.
-Or, if you prefer, __use two underscores instead__.
-
- -

Output:

- -
<p>Some of these words <em>are emphasized</em>.
-Some of these words <em>are emphasized also</em>.</p>
-
-<p>Use two asterisks for <strong>strong emphasis</strong>.
-Or, if you prefer, <strong>use two underscores instead</strong>.</p>
-
- -

Lists

- -

Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, -+, and -) as list markers. These three markers are -interchangable; this:

- -
*   Candy.
-*   Gum.
-*   Booze.
-
- -

this:

- -
+   Candy.
-+   Gum.
-+   Booze.
-
- -

and this:

- -
-   Candy.
--   Gum.
--   Booze.
-
- -

all produce the same output:

- -
<ul>
-<li>Candy.</li>
-<li>Gum.</li>
-<li>Booze.</li>
-</ul>
-
- -

Ordered (numbered) lists use regular numbers, followed by periods, as -list markers:

- -
1.  Red
-2.  Green
-3.  Blue
-
- -

Output:

- -
<ol>
-<li>Red</li>
-<li>Green</li>
-<li>Blue</li>
-</ol>
-
- -

If you put blank lines between items, you'll get <p> tags for the -list item text. You can create multi-paragraph list items by indenting -the paragraphs by 4 spaces or 1 tab:

- -
*   A list item.
-
-    With multiple paragraphs.
-
-*   Another item in the list.
-
- -

Output:

- -
<ul>
-<li><p>A list item.</p>
-<p>With multiple paragraphs.</p></li>
-<li><p>Another item in the list.</p></li>
-</ul>
-
- -

Links

- -

Markdown supports two styles for creating links: inline and -reference. With both styles, you use square brackets to delimit the -text you want to turn into a link.

- -

Inline-style links use parentheses immediately after the link text. -For example:

- -
This is an [example link](http://example.com/).
-
- -

Output:

- -
<p>This is an <a href="http://example.com/">
-example link</a>.</p>
-
- -

Optionally, you may include a title attribute in the parentheses:

- -
This is an [example link](http://example.com/ "With a Title").
-
- -

Output:

- -
<p>This is an <a href="http://example.com/" title="With a Title">
-example link</a>.</p>
-
- -

Reference-style links allow you to refer to your links by names, which -you define elsewhere in your document:

- -
I get 10 times more traffic from [Google][1] than from
-[Yahoo][2] or [MSN][3].
-
-[1]: http://google.com/        "Google"
-[2]: http://search.yahoo.com/  "Yahoo Search"
-[3]: http://search.msn.com/    "MSN Search"
-
- -

Output:

- -
<p>I get 10 times more traffic from <a href="http://google.com/"
-title="Google">Google</a> than from <a href="http://search.yahoo.com/"
-title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
-title="MSN Search">MSN</a>.</p>
-
- -

The title attribute is optional. Link names may contain letters, -numbers and spaces, but are not case sensitive:

- -
I start my morning with a cup of coffee and
-[The New York Times][NY Times].
-
-[ny times]: http://www.nytimes.com/
-
- -

Output:

- -
<p>I start my morning with a cup of coffee and
-<a href="http://www.nytimes.com/">The New York Times</a>.</p>
-
- -

Images

- -

Image syntax is very much like link syntax.

- -

Inline (titles are optional):

- -
![alt text](/path/to/img.jpg "Title")
-
- -

Reference-style:

- -
![alt text][id]
-
-[id]: /path/to/img.jpg "Title"
-
- -

Both of the above examples produce the same output:

- -
<img src="/path/to/img.jpg" alt="alt text" title="Title" />
-
- -

Code

- -

In a regular paragraph, you can create code span by wrapping text in -backtick quotes. Any ampersands (&) and angle brackets (< or ->) will automatically be translated into HTML entities. This makes -it easy to use Markdown to write about HTML example code:

- -
I strongly recommend against using any `<blink>` tags.
-
-I wish SmartyPants used named entities like `&mdash;`
-instead of decimal-encoded entites like `&#8212;`.
-
- -

Output:

- -
<p>I strongly recommend against using any
-<code>&lt;blink&gt;</code> tags.</p>
-
-<p>I wish SmartyPants used named entities like
-<code>&amp;mdash;</code> instead of decimal-encoded
-entites like <code>&amp;#8212;</code>.</p>
-
- -

To specify an entire block of pre-formatted code, indent every line of -the block by 4 spaces or 1 tab. Just like with code spans, &, <, -and > characters will be escaped automatically.

- -

Markdown:

- -
If you want your page to validate under XHTML 1.0 Strict,
-you've got to put paragraph tags in your blockquotes:
-
-    <blockquote>
-        <p>For example.</p>
-    </blockquote>
-
- -

Output:

- -
<p>If you want your page to validate under XHTML 1.0 Strict,
-you've got to put paragraph tags in your blockquotes:</p>
-
-<pre><code>&lt;blockquote&gt;
-    &lt;p&gt;For example.&lt;/p&gt;
-&lt;/blockquote&gt;
-</code></pre>
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Basics.text b/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Basics.text deleted file mode 100644 index 486055ca7f8..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Basics.text +++ /dev/null @@ -1,306 +0,0 @@ -Markdown: Basics -================ - - - - -Getting the Gist of Markdown's Formatting Syntax ------------------------------------------------- - -This page offers a brief overview of what it's like to use Markdown. -The [syntax page] [s] provides complete, detailed documentation for -every feature, but Markdown should be very easy to pick up simply by -looking at a few examples of it in action. The examples on this page -are written in a before/after style, showing example syntax and the -HTML output produced by Markdown. - -It's also helpful to simply try Markdown out; the [Dingus] [d] is a -web application that allows you type your own Markdown-formatted text -and translate it to XHTML. - -**Note:** This document is itself written using Markdown; you -can [see the source for it by adding '.text' to the URL] [src]. - - [s]: /projects/markdown/syntax "Markdown Syntax" - [d]: /projects/markdown/dingus "Markdown Dingus" - [src]: /projects/markdown/basics.text - - -## Paragraphs, Headers, Blockquotes ## - -A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs. - -Markdown offers two styles of headers: *Setext* and *atx*. -Setext-style headers for `

` and `

` are created by -"underlining" with equal signs (`=`) and hyphens (`-`), respectively. -To create an atx-style header, you put 1-6 hash marks (`#`) at the -beginning of the line -- the number of hashes equals the resulting -HTML header level. - -Blockquotes are indicated using email-style '`>`' angle brackets. - -Markdown: - - A First Level Header - ==================== - - A Second Level Header - --------------------- - - Now is the time for all good men to come to - the aid of their country. This is just a - regular paragraph. - - The quick brown fox jumped over the lazy - dog's back. - - ### Header 3 - - > This is a blockquote. - > - > This is the second paragraph in the blockquote. - > - > ## This is an H2 in a blockquote - - -Output: - -

A First Level Header

- -

A Second Level Header

- -

Now is the time for all good men to come to - the aid of their country. This is just a - regular paragraph.

- -

The quick brown fox jumped over the lazy - dog's back.

- -

Header 3

- -
-

This is a blockquote.

- -

This is the second paragraph in the blockquote.

- -

This is an H2 in a blockquote

-
- - - -### Phrase Emphasis ### - -Markdown uses asterisks and underscores to indicate spans of emphasis. - -Markdown: - - Some of these words *are emphasized*. - Some of these words _are emphasized also_. - - Use two asterisks for **strong emphasis**. - Or, if you prefer, __use two underscores instead__. - -Output: - -

Some of these words are emphasized. - Some of these words are emphasized also.

- -

Use two asterisks for strong emphasis. - Or, if you prefer, use two underscores instead.

- - - -## Lists ## - -Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, -`+`, and `-`) as list markers. These three markers are -interchangable; this: - - * Candy. - * Gum. - * Booze. - -this: - - + Candy. - + Gum. - + Booze. - -and this: - - - Candy. - - Gum. - - Booze. - -all produce the same output: - -
    -
  • Candy.
  • -
  • Gum.
  • -
  • Booze.
  • -
- -Ordered (numbered) lists use regular numbers, followed by periods, as -list markers: - - 1. Red - 2. Green - 3. Blue - -Output: - -
    -
  1. Red
  2. -
  3. Green
  4. -
  5. Blue
  6. -
- -If you put blank lines between items, you'll get `

` tags for the -list item text. You can create multi-paragraph list items by indenting -the paragraphs by 4 spaces or 1 tab: - - * A list item. - - With multiple paragraphs. - - * Another item in the list. - -Output: - -

    -
  • A list item.

    -

    With multiple paragraphs.

  • -
  • Another item in the list.

  • -
- - - -### Links ### - -Markdown supports two styles for creating links: *inline* and -*reference*. With both styles, you use square brackets to delimit the -text you want to turn into a link. - -Inline-style links use parentheses immediately after the link text. -For example: - - This is an [example link](http://example.com/). - -Output: - -

This is an - example link.

- -Optionally, you may include a title attribute in the parentheses: - - This is an [example link](http://example.com/ "With a Title"). - -Output: - -

This is an - example link.

- -Reference-style links allow you to refer to your links by names, which -you define elsewhere in your document: - - I get 10 times more traffic from [Google][1] than from - [Yahoo][2] or [MSN][3]. - - [1]: http://google.com/ "Google" - [2]: http://search.yahoo.com/ "Yahoo Search" - [3]: http://search.msn.com/ "MSN Search" - -Output: - -

I get 10 times more traffic from Google than from Yahoo or MSN.

- -The title attribute is optional. Link names may contain letters, -numbers and spaces, but are *not* case sensitive: - - I start my morning with a cup of coffee and - [The New York Times][NY Times]. - - [ny times]: http://www.nytimes.com/ - -Output: - -

I start my morning with a cup of coffee and - The New York Times.

- - -### Images ### - -Image syntax is very much like link syntax. - -Inline (titles are optional): - - ![alt text](/path/to/img.jpg "Title") - -Reference-style: - - ![alt text][id] - - [id]: /path/to/img.jpg "Title" - -Both of the above examples produce the same output: - - alt text - - - -### Code ### - -In a regular paragraph, you can create code span by wrapping text in -backtick quotes. Any ampersands (`&`) and angle brackets (`<` or -`>`) will automatically be translated into HTML entities. This makes -it easy to use Markdown to write about HTML example code: - - I strongly recommend against using any `` tags. - - I wish SmartyPants used named entities like `—` - instead of decimal-encoded entites like `—`. - -Output: - -

I strongly recommend against using any - <blink> tags.

- -

I wish SmartyPants used named entities like - &mdash; instead of decimal-encoded - entites like &#8212;.

- - -To specify an entire block of pre-formatted code, indent every line of -the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, -and `>` characters will be escaped automatically. - -Markdown: - - If you want your page to validate under XHTML 1.0 Strict, - you've got to put paragraph tags in your blockquotes: - -
-

For example.

-
- -Output: - -

If you want your page to validate under XHTML 1.0 Strict, - you've got to put paragraph tags in your blockquotes:

- -
<blockquote>
-        <p>For example.</p>
-    </blockquote>
-    
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Syntax.html b/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Syntax.html deleted file mode 100644 index 61dde593dac..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Syntax.html +++ /dev/null @@ -1,946 +0,0 @@ -

Markdown: Syntax

- - - - - -

Note: This document is itself written using Markdown; you -can see the source for it by adding '.text' to the URL.

- -
- -

Overview

- -

Philosophy

- -

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

- -

Readability, however, is emphasized above all else. A Markdown-formatted -document should be publishable as-is, as plain text, without looking -like it's been marked up with tags or formatting instructions. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including Setext, atx, Textile, reStructuredText, -Grutatext, and EtText -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email.

- -

To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like *emphasis*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email.

- -

Inline HTML

- -

Markdown's syntax is intended for one purpose: to be used as a -format for writing for the web.

- -

Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is not to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a publishing format; Markdown is a writing -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text.

- -

For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags.

- -

The only restrictions are that block-level HTML elements -- e.g. <div>, -<table>, <pre>, <p>, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) <p> tags around HTML block-level tags.

- -

For example, to add an HTML table to a Markdown article:

- -
This is a regular paragraph.
-
-<table>
-    <tr>
-        <td>Foo</td>
-    </tr>
-</table>
-
-This is another regular paragraph.
-
- -

Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style *emphasis* inside an -HTML block.

- -

Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML <a> or <img> tags instead of Markdown's -link or image syntax, go right ahead.

- -

Unlike block-level HTML tags, Markdown syntax is processed within -span-level tags.

- -

Automatic Escaping for Special Characters

- -

In HTML, there are two characters that demand special treatment: < -and &. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. &lt;, and -&amp;.

- -

Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write 'AT&amp;T'. You even need to -escape ampersands within URLs. Thus, if you want to link to:

- -
http://images.google.com/images?num=30&q=larry+bird
-
- -

you need to encode the URL as:

- -
http://images.google.com/images?num=30&amp;q=larry+bird
-
- -

in your anchor tag href attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites.

- -

Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into &amp;.

- -

So, if you want to include a copyright symbol in your article, you can write:

- -
&copy;
-
- -

and Markdown will leave it alone. But if you write:

- -
AT&T
-
- -

Markdown will translate it to:

- -
AT&amp;T
-
- -

Similarly, because Markdown supports inline HTML, if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write:

- -
4 < 5
-
- -

Markdown will translate it to:

- -
4 &lt; 5
-
- -

However, inside Markdown code spans and blocks, angle brackets and -ampersands are always encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single < -and & in your example code needs to be escaped.)

- -
- -

Block Elements

- -

Paragraphs and Line Breaks

- -

A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs.

- -

The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a <br /> tag.

- -

When you do want to insert a <br /> break tag using Markdown, you -end a line with two or more spaces, then type return.

- -

Yes, this takes a tad more effort to create a <br />, but a simplistic -"every line break is a <br />" rule wouldn't work for Markdown. -Markdown's email-style blockquoting and multi-paragraph list items -work best -- and look better -- when you format them with hard breaks.

- - - -

Markdown supports two styles of headers, Setext and atx.

- -

Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example:

- -
This is an H1
-=============
-
-This is an H2
--------------
-
- -

Any number of underlining ='s or -'s will work.

- -

Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example:

- -
# This is an H1
-
-## This is an H2
-
-###### This is an H6
-
- -

Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) :

- -
# This is an H1 #
-
-## This is an H2 ##
-
-### This is an H3 ######
-
- -

Blockquotes

- -

Markdown uses email-style > characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a > before every line:

- -
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
-> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
-> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
-> 
-> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
-> id sem consectetuer libero luctus adipiscing.
-
- -

Markdown allows you to be lazy and only put the > before the first -line of a hard-wrapped paragraph:

- -
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
-consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
-Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
-
-> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
-id sem consectetuer libero luctus adipiscing.
-
- -

Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of >:

- -
> This is the first level of quoting.
->
-> > This is nested blockquote.
->
-> Back to the first level.
-
- -

Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks:

- -
> ## This is a header.
-> 
-> 1.   This is the first list item.
-> 2.   This is the second list item.
-> 
-> Here's some example code:
-> 
->     return shell_exec("echo $input | $markdown_script");
-
- -

Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu.

- -

Lists

- -

Markdown supports ordered (numbered) and unordered (bulleted) lists.

- -

Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers:

- -
*   Red
-*   Green
-*   Blue
-
- -

is equivalent to:

- -
+   Red
-+   Green
-+   Blue
-
- -

and:

- -
-   Red
--   Green
--   Blue
-
- -

Ordered lists use numbers followed by periods:

- -
1.  Bird
-2.  McHale
-3.  Parish
-
- -

It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is:

- -
<ol>
-<li>Bird</li>
-<li>McHale</li>
-<li>Parish</li>
-</ol>
-
- -

If you instead wrote the list in Markdown like this:

- -
1.  Bird
-1.  McHale
-1.  Parish
-
- -

or even:

- -
3. Bird
-1. McHale
-8. Parish
-
- -

you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to.

- -

If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number.

- -

List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab.

- -

To make lists look nice, you can wrap items with hanging indents:

- -
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
-    viverra nec, fringilla in, laoreet vitae, risus.
-*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
-    Suspendisse id sem consectetuer libero luctus adipiscing.
-
- -

But if you want to be lazy, you don't have to:

- -
*   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
-viverra nec, fringilla in, laoreet vitae, risus.
-*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
-Suspendisse id sem consectetuer libero luctus adipiscing.
-
- -

If list items are separated by blank lines, Markdown will wrap the -items in <p> tags in the HTML output. For example, this input:

- -
*   Bird
-*   Magic
-
- -

will turn into:

- -
<ul>
-<li>Bird</li>
-<li>Magic</li>
-</ul>
-
- -

But this:

- -
*   Bird
-
-*   Magic
-
- -

will turn into:

- -
<ul>
-<li><p>Bird</p></li>
-<li><p>Magic</p></li>
-</ul>
-
- -

List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab:

- -
1.  This is a list item with two paragraphs. Lorem ipsum dolor
-    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
-    mi posuere lectus.
-
-    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
-    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
-    sit amet velit.
-
-2.  Suspendisse id sem consectetuer libero luctus adipiscing.
-
- -

It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy:

- -
*   This is a list item with two paragraphs.
-
-    This is the second paragraph in the list item. You're
-only required to indent the first line. Lorem ipsum dolor
-sit amet, consectetuer adipiscing elit.
-
-*   Another item in the same list.
-
- -

To put a blockquote within a list item, the blockquote's > -delimiters need to be indented:

- -
*   A list item with a blockquote:
-
-    > This is a blockquote
-    > inside a list item.
-
- -

To put a code block within a list item, the code block needs -to be indented twice -- 8 spaces or two tabs:

- -
*   A list item with a code block:
-
-        <code goes here>
-
- -

It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this:

- -
1986. What a great season.
-
- -

In other words, a number-period-space sequence at the beginning of a -line. To avoid this, you can backslash-escape the period:

- -
1986\. What a great season.
-
- -

Code Blocks

- -

Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both <pre> and <code> tags.

- -

To produce a code block in Markdown, simply indent every line of the -block by at least 4 spaces or 1 tab. For example, given this input:

- -
This is a normal paragraph:
-
-    This is a code block.
-
- -

Markdown will generate:

- -
<p>This is a normal paragraph:</p>
-
-<pre><code>This is a code block.
-</code></pre>
-
- -

One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this:

- -
Here is an example of AppleScript:
-
-    tell application "Foo"
-        beep
-    end tell
-
- -

will turn into:

- -
<p>Here is an example of AppleScript:</p>
-
-<pre><code>tell application "Foo"
-    beep
-end tell
-</code></pre>
-
- -

A code block continues until it reaches a line that is not indented -(or the end of the article).

- -

Within a code block, ampersands (&) and angle brackets (< and >) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this:

- -
    <div class="footer">
-        &copy; 2004 Foo Corporation
-    </div>
-
- -

will turn into:

- -
<pre><code>&lt;div class="footer"&gt;
-    &amp;copy; 2004 Foo Corporation
-&lt;/div&gt;
-</code></pre>
-
- -

Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax.

- -

Horizontal Rules

- -

You can produce a horizontal rule tag (<hr />) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule:

- -
* * *
-
-***
-
-*****
-
-- - -
-
----------------------------------------
-
-_ _ _
-
- -
- -

Span Elements

- - - -

Markdown supports two style of links: inline and reference.

- -

In both styles, the link text is delimited by [square brackets].

- -

To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an optional -title for the link, surrounded in quotes. For example:

- -
This is [an example](http://example.com/ "Title") inline link.
-
-[This link](http://example.net/) has no title attribute.
-
- -

Will produce:

- -
<p>This is <a href="http://example.com/" title="Title">
-an example</a> inline link.</p>
-
-<p><a href="http://example.net/">This link</a> has no
-title attribute.</p>
-
- -

If you're referring to a local resource on the same server, you can -use relative paths:

- -
See my [About](/about/) page for details.
-
- -

Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link:

- -
This is [an example][id] reference-style link.
-
- -

You can optionally use a space to separate the sets of brackets:

- -
This is [an example] [id] reference-style link.
-
- -

Then, anywhere in the document, you define your link label like this, -on a line by itself:

- -
[id]: http://example.com/  "Optional Title Here"
-
- -

That is:

- -
    -
  • Square brackets containing the link identifier (optionally -indented from the left margin using up to three spaces);
  • -
  • followed by a colon;
  • -
  • followed by one or more spaces (or tabs);
  • -
  • followed by the URL for the link;
  • -
  • optionally followed by a title attribute for the link, enclosed -in double or single quotes.
  • -
- -

The link URL may, optionally, be surrounded by angle brackets:

- -
[id]: <http://example.com/>  "Optional Title Here"
-
- -

You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs:

- -
[id]: http://example.com/longish/path/to/resource/here
-    "Optional Title Here"
-
- -

Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output.

- -

Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:

- -
[link text][a]
-[link text][A]
-
- -

are equivalent.

- -

The implicit link name shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write:

- -
[Google][]
-
- -

And then define the link:

- -
[Google]: http://google.com/
-
- -

Because link names may contain spaces, this shortcut even works for -multiple words in the link text:

- -
Visit [Daring Fireball][] for more information.
-
- -

And then define the link:

- -
[Daring Fireball]: http://daringfireball.net/
-
- -

Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes.

- -

Here's an example of reference links in action:

- -
I get 10 times more traffic from [Google] [1] than from
-[Yahoo] [2] or [MSN] [3].
-
-  [1]: http://google.com/        "Google"
-  [2]: http://search.yahoo.com/  "Yahoo Search"
-  [3]: http://search.msn.com/    "MSN Search"
-
- -

Using the implicit link name shortcut, you could instead write:

- -
I get 10 times more traffic from [Google][] than from
-[Yahoo][] or [MSN][].
-
-  [google]: http://google.com/        "Google"
-  [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
-  [msn]:    http://search.msn.com/    "MSN Search"
-
- -

Both of the above examples will produce the following HTML output:

- -
<p>I get 10 times more traffic from <a href="http://google.com/"
-title="Google">Google</a> than from
-<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
-or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
-
- -

For comparison, here is the same paragraph written using -Markdown's inline link style:

- -
I get 10 times more traffic from [Google](http://google.com/ "Google")
-than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
-[MSN](http://search.msn.com/ "MSN Search").
-
- -

The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text.

- -

With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose.

- -

Emphasis

- -

Markdown treats asterisks (*) and underscores (_) as indicators of -emphasis. Text wrapped with one * or _ will be wrapped with an -HTML <em> tag; double *'s or _'s will be wrapped with an HTML -<strong> tag. E.g., this input:

- -
*single asterisks*
-
-_single underscores_
-
-**double asterisks**
-
-__double underscores__
-
- -

will produce:

- -
<em>single asterisks</em>
-
-<em>single underscores</em>
-
-<strong>double asterisks</strong>
-
-<strong>double underscores</strong>
-
- -

You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span.

- -

Emphasis can be used in the middle of a word:

- -
un*fucking*believable
-
- -

But if you surround an * or _ with spaces, it'll be treated as a -literal asterisk or underscore.

- -

To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it:

- -
\*this text is surrounded by literal asterisks\*
-
- -

Code

- -

To indicate a span of code, wrap it with backtick quotes (`). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example:

- -
Use the `printf()` function.
-
- -

will produce:

- -
<p>Use the <code>printf()</code> function.</p>
-
- -

To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters:

- -
``There is a literal backtick (`) here.``
-
- -

which will produce this:

- -
<p><code>There is a literal backtick (`) here.</code></p>
-
- -

The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span:

- -
A single backtick in a code span: `` ` ``
-
-A backtick-delimited string in a code span: `` `foo` ``
-
- -

will produce:

- -
<p>A single backtick in a code span: <code>`</code></p>
-
-<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
-
- -

With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this:

- -
Please don't use any `<blink>` tags.
-
- -

into:

- -
<p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
-
- -

You can write this:

- -
`&#8212;` is the decimal-encoded equivalent of `&mdash;`.
-
- -

to produce:

- -
<p><code>&amp;#8212;</code> is the decimal-encoded
-equivalent of <code>&amp;mdash;</code>.</p>
-
- -

Images

- -

Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format.

- -

Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: inline and reference.

- -

Inline image syntax looks like this:

- -
![Alt text](/path/to/img.jpg)
-
-![Alt text](/path/to/img.jpg "Optional title")
-
- -

That is:

- -
    -
  • An exclamation mark: !;
  • -
  • followed by a set of square brackets, containing the alt -attribute text for the image;
  • -
  • followed by a set of parentheses, containing the URL or path to -the image, and an optional title attribute enclosed in double -or single quotes.
  • -
- -

Reference-style image syntax looks like this:

- -
![Alt text][id]
-
- -

Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references:

- -
[id]: url/to/image  "Optional title attribute"
-
- -

As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML <img> tags.

- -
- -

Miscellaneous

- - - -

Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

- -
<http://example.com/>
-
- -

Markdown will turn this into:

- -
<a href="http://example.com/">http://example.com/</a>
-
- -

Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this:

- -
<address@example.com>
-
- -

into something like this:

- -
<a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
-&#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
-&#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
-&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
-
- -

which will render in a browser as a clickable link to "address@example.com".

- -

(This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.)

- -

Backslash Escapes

- -

Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML <em> tag), you can backslashes -before the asterisks, like this:

- -
\*literal asterisks\*
-
- -

Markdown provides backslash escapes for the following characters:

- -
\   backslash
-`   backtick
-*   asterisk
-_   underscore
-{}  curly braces
-[]  square brackets
-()  parentheses
-#   hash mark
-+   plus sign
--   minus sign (hyphen)
-.   dot
-!   exclamation mark
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Syntax.text b/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Syntax.text deleted file mode 100644 index 57360a16c81..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Markdown Documentation - Syntax.text +++ /dev/null @@ -1,888 +0,0 @@ -Markdown: Syntax -================ - - - - -* [Overview](#overview) - * [Philosophy](#philosophy) - * [Inline HTML](#html) - * [Automatic Escaping for Special Characters](#autoescape) -* [Block Elements](#block) - * [Paragraphs and Line Breaks](#p) - * [Headers](#header) - * [Blockquotes](#blockquote) - * [Lists](#list) - * [Code Blocks](#precode) - * [Horizontal Rules](#hr) -* [Span Elements](#span) - * [Links](#link) - * [Emphasis](#em) - * [Code](#code) - * [Images](#img) -* [Miscellaneous](#misc) - * [Backslash Escapes](#backslash) - * [Automatic Links](#autolink) - - -**Note:** This document is itself written using Markdown; you -can [see the source for it by adding '.text' to the URL][src]. - - [src]: /projects/markdown/syntax.text - -* * * - -

Overview

- -

Philosophy

- -Markdown is intended to be as easy-to-read and easy-to-write as is feasible. - -Readability, however, is emphasized above all else. A Markdown-formatted -document should be publishable as-is, as plain text, without looking -like it's been marked up with tags or formatting instructions. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], -[Grutatext] [5], and [EtText] [6] -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email. - - [1]: http://docutils.sourceforge.net/mirror/setext.html - [2]: http://www.aaronsw.com/2002/atx/ - [3]: http://textism.com/tools/textile/ - [4]: http://docutils.sourceforge.net/rst.html - [5]: http://www.triptico.com/software/grutatxt.html - [6]: http://ettext.taint.org/doc/ - -To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like \*emphasis\*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email. - - - -

Inline HTML

- -Markdown's syntax is intended for one purpose: to be used as a -format for *writing* for the web. - -Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is *not* to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a *publishing* format; Markdown is a *writing* -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text. - -For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags. - -The only restrictions are that block-level HTML elements -- e.g. `
`, -``, `
`, `

`, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) `

` tags around HTML block-level tags. - -For example, to add an HTML table to a Markdown article: - - This is a regular paragraph. - -

- - - -
Foo
- - This is another regular paragraph. - -Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an -HTML block. - -Span-level HTML tags -- e.g. ``, ``, or `` -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML `` or `` tags instead of Markdown's -link or image syntax, go right ahead. - -Unlike block-level HTML tags, Markdown syntax *is* processed within -span-level tags. - - -

Automatic Escaping for Special Characters

- -In HTML, there are two characters that demand special treatment: `<` -and `&`. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. `<`, and -`&`. - -Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write '`AT&T`'. You even need to -escape ampersands within URLs. Thus, if you want to link to: - - http://images.google.com/images?num=30&q=larry+bird - -you need to encode the URL as: - - http://images.google.com/images?num=30&q=larry+bird - -in your anchor tag `href` attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites. - -Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into `&`. - -So, if you want to include a copyright symbol in your article, you can write: - - © - -and Markdown will leave it alone. But if you write: - - AT&T - -Markdown will translate it to: - - AT&T - -Similarly, because Markdown supports [inline HTML](#html), if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write: - - 4 < 5 - -Markdown will translate it to: - - 4 < 5 - -However, inside Markdown code spans and blocks, angle brackets and -ampersands are *always* encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single `<` -and `&` in your example code needs to be escaped.) - - -* * * - - -

Block Elements

- - -

Paragraphs and Line Breaks

- -A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs. - -The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a `
` tag. - -When you *do* want to insert a `
` break tag using Markdown, you -end a line with two or more spaces, then type return. - -Yes, this takes a tad more effort to create a `
`, but a simplistic -"every line break is a `
`" rule wouldn't work for Markdown. -Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] -work best -- and look better -- when you format them with hard breaks. - - [bq]: #blockquote - [l]: #list - - - - - -Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. - -Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example: - - This is an H1 - ============= - - This is an H2 - ------------- - -Any number of underlining `=`'s or `-`'s will work. - -Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example: - - # This is an H1 - - ## This is an H2 - - ###### This is an H6 - -Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) : - - # This is an H1 # - - ## This is an H2 ## - - ### This is an H3 ###### - - -

Blockquotes

- -Markdown uses email-style `>` characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a `>` before every line: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - > - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - > id sem consectetuer libero luctus adipiscing. - -Markdown allows you to be lazy and only put the `>` before the first -line of a hard-wrapped paragraph: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - id sem consectetuer libero luctus adipiscing. - -Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of `>`: - - > This is the first level of quoting. - > - > > This is nested blockquote. - > - > Back to the first level. - -Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks: - - > ## This is a header. - > - > 1. This is the first list item. - > 2. This is the second list item. - > - > Here's some example code: - > - > return shell_exec("echo $input | $markdown_script"); - -Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu. - - -

Lists

- -Markdown supports ordered (numbered) and unordered (bulleted) lists. - -Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers: - - * Red - * Green - * Blue - -is equivalent to: - - + Red - + Green - + Blue - -and: - - - Red - - Green - - Blue - -Ordered lists use numbers followed by periods: - - 1. Bird - 2. McHale - 3. Parish - -It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is: - -
    -
  1. Bird
  2. -
  3. McHale
  4. -
  5. Parish
  6. -
- -If you instead wrote the list in Markdown like this: - - 1. Bird - 1. McHale - 1. Parish - -or even: - - 3. Bird - 1. McHale - 8. Parish - -you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to. - -If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number. - -List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab. - -To make lists look nice, you can wrap items with hanging indents: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -But if you want to be lazy, you don't have to: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -If list items are separated by blank lines, Markdown will wrap the -items in `

` tags in the HTML output. For example, this input: - - * Bird - * Magic - -will turn into: - -

    -
  • Bird
  • -
  • Magic
  • -
- -But this: - - * Bird - - * Magic - -will turn into: - -
    -
  • Bird

  • -
  • Magic

  • -
- -List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab: - - 1. This is a list item with two paragraphs. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. Aliquam hendrerit - mi posuere lectus. - - Vestibulum enim wisi, viverra nec, fringilla in, laoreet - vitae, risus. Donec sit amet nisl. Aliquam semper ipsum - sit amet velit. - - 2. Suspendisse id sem consectetuer libero luctus adipiscing. - -It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy: - - * This is a list item with two paragraphs. - - This is the second paragraph in the list item. You're - only required to indent the first line. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. - - * Another item in the same list. - -To put a blockquote within a list item, the blockquote's `>` -delimiters need to be indented: - - * A list item with a blockquote: - - > This is a blockquote - > inside a list item. - -To put a code block within a list item, the code block needs -to be indented *twice* -- 8 spaces or two tabs: - - * A list item with a code block: - - - - -It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this: - - 1986. What a great season. - -In other words, a *number-period-space* sequence at the beginning of a -line. To avoid this, you can backslash-escape the period: - - 1986\. What a great season. - - - -

Code Blocks

- -Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both `
` and `` tags.
-
-To produce a code block in Markdown, simply indent every line of the
-block by at least 4 spaces or 1 tab. For example, given this input:
-
-    This is a normal paragraph:
-
-        This is a code block.
-
-Markdown will generate:
-
-    

This is a normal paragraph:

- -
This is a code block.
-    
- -One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this: - - Here is an example of AppleScript: - - tell application "Foo" - beep - end tell - -will turn into: - -

Here is an example of AppleScript:

- -
tell application "Foo"
-        beep
-    end tell
-    
- -A code block continues until it reaches a line that is not indented -(or the end of the article). - -Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this: - - - -will turn into: - -
<div class="footer">
-        &copy; 2004 Foo Corporation
-    </div>
-    
- -Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax. - - - -

Horizontal Rules

- -You can produce a horizontal rule tag (`
`) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule: - - * * * - - *** - - ***** - - - - - - - --------------------------------------- - - _ _ _ - - -* * * - -

Span Elements

- - - -Markdown supports two style of links: *inline* and *reference*. - -In both styles, the link text is delimited by [square brackets]. - -To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an *optional* -title for the link, surrounded in quotes. For example: - - This is [an example](http://example.com/ "Title") inline link. - - [This link](http://example.net/) has no title attribute. - -Will produce: - -

This is - an example inline link.

- -

This link has no - title attribute.

- -If you're referring to a local resource on the same server, you can -use relative paths: - - See my [About](/about/) page for details. - -Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link: - - This is [an example][id] reference-style link. - -You can optionally use a space to separate the sets of brackets: - - This is [an example] [id] reference-style link. - -Then, anywhere in the document, you define your link label like this, -on a line by itself: - - [id]: http://example.com/ "Optional Title Here" - -That is: - -* Square brackets containing the link identifier (optionally - indented from the left margin using up to three spaces); -* followed by a colon; -* followed by one or more spaces (or tabs); -* followed by the URL for the link; -* optionally followed by a title attribute for the link, enclosed - in double or single quotes. - -The link URL may, optionally, be surrounded by angle brackets: - - [id]: "Optional Title Here" - -You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs: - - [id]: http://example.com/longish/path/to/resource/here - "Optional Title Here" - -Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output. - -Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: - - [link text][a] - [link text][A] - -are equivalent. - -The *implicit link name* shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write: - - [Google][] - -And then define the link: - - [Google]: http://google.com/ - -Because link names may contain spaces, this shortcut even works for -multiple words in the link text: - - Visit [Daring Fireball][] for more information. - -And then define the link: - - [Daring Fireball]: http://daringfireball.net/ - -Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes. - -Here's an example of reference links in action: - - I get 10 times more traffic from [Google] [1] than from - [Yahoo] [2] or [MSN] [3]. - - [1]: http://google.com/ "Google" - [2]: http://search.yahoo.com/ "Yahoo Search" - [3]: http://search.msn.com/ "MSN Search" - -Using the implicit link name shortcut, you could instead write: - - I get 10 times more traffic from [Google][] than from - [Yahoo][] or [MSN][]. - - [google]: http://google.com/ "Google" - [yahoo]: http://search.yahoo.com/ "Yahoo Search" - [msn]: http://search.msn.com/ "MSN Search" - -Both of the above examples will produce the following HTML output: - -

I get 10 times more traffic from Google than from - Yahoo - or MSN.

- -For comparison, here is the same paragraph written using -Markdown's inline link style: - - I get 10 times more traffic from [Google](http://google.com/ "Google") - than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or - [MSN](http://search.msn.com/ "MSN Search"). - -The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text. - -With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose. - - -

Emphasis

- -Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -emphasis. Text wrapped with one `*` or `_` will be wrapped with an -HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML -`` tag. E.g., this input: - - *single asterisks* - - _single underscores_ - - **double asterisks** - - __double underscores__ - -will produce: - - single asterisks - - single underscores - - double asterisks - - double underscores - -You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span. - -Emphasis can be used in the middle of a word: - - un*fucking*believable - -But if you surround an `*` or `_` with spaces, it'll be treated as a -literal asterisk or underscore. - -To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it: - - \*this text is surrounded by literal asterisks\* - - - -

Code

- -To indicate a span of code, wrap it with backtick quotes (`` ` ``). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example: - - Use the `printf()` function. - -will produce: - -

Use the printf() function.

- -To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters: - - ``There is a literal backtick (`) here.`` - -which will produce this: - -

There is a literal backtick (`) here.

- -The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span: - - A single backtick in a code span: `` ` `` - - A backtick-delimited string in a code span: `` `foo` `` - -will produce: - -

A single backtick in a code span: `

- -

A backtick-delimited string in a code span: `foo`

- -With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this: - - Please don't use any `` tags. - -into: - -

Please don't use any <blink> tags.

- -You can write this: - - `—` is the decimal-encoded equivalent of `—`. - -to produce: - -

&#8212; is the decimal-encoded - equivalent of &mdash;.

- - - -

Images

- -Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format. - -Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: *inline* and *reference*. - -Inline image syntax looks like this: - - ![Alt text](/path/to/img.jpg) - - ![Alt text](/path/to/img.jpg "Optional title") - -That is: - -* An exclamation mark: `!`; -* followed by a set of square brackets, containing the `alt` - attribute text for the image; -* followed by a set of parentheses, containing the URL or path to - the image, and an optional `title` attribute enclosed in double - or single quotes. - -Reference-style image syntax looks like this: - - ![Alt text][id] - -Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references: - - [id]: url/to/image "Optional title attribute" - -As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML `` tags. - - -* * * - - -

Miscellaneous

- - - -Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: - - - -Markdown will turn this into: - - http://example.com/ - -Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this: - - - -into something like this: - - address@exa - mple.com - -which will render in a browser as a clickable link to "address@example.com". - -(This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.) - - - -

Backslash Escapes

- -Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML `` tag), you can backslashes -before the asterisks, like this: - - \*literal asterisks\* - -Markdown provides backslash escapes for the following characters: - - \ backslash - ` backtick - * asterisk - _ underscore - {} curly braces - [] square brackets - () parentheses - # hash mark - + plus sign - - minus sign (hyphen) - . dot - ! exclamation mark - diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Nested blockquotes.html b/vendor/github.com/russross/blackfriday/upskirtref/Nested blockquotes.html deleted file mode 100644 index 538bb4fe75b..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Nested blockquotes.html +++ /dev/null @@ -1,9 +0,0 @@ -
-

foo

- -
-

bar

-
- -

foo

-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Nested blockquotes.text b/vendor/github.com/russross/blackfriday/upskirtref/Nested blockquotes.text deleted file mode 100644 index ed3c624ffbe..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Nested blockquotes.text +++ /dev/null @@ -1,5 +0,0 @@ -> foo -> -> > bar -> -> foo diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Ordered and unordered lists.html b/vendor/github.com/russross/blackfriday/upskirtref/Ordered and unordered lists.html deleted file mode 100644 index d6fa42780a5..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Ordered and unordered lists.html +++ /dev/null @@ -1,166 +0,0 @@ -

Unordered

- -

Asterisks tight:

- -
    -
  • asterisk 1
  • -
  • asterisk 2
  • -
  • asterisk 3
  • -
- -

Asterisks loose:

- -
    -
  • asterisk 1

  • - -
  • asterisk 2

  • - -
  • asterisk 3

  • -
- -
- -

Pluses tight:

- -
    -
  • Plus 1
  • -
  • Plus 2
  • -
  • Plus 3
  • -
- -

Pluses loose:

- -
    -
  • Plus 1

  • - -
  • Plus 2

  • - -
  • Plus 3

  • -
- -
- -

Minuses tight:

- -
    -
  • Minus 1
  • -
  • Minus 2
  • -
  • Minus 3
  • -
- -

Minuses loose:

- -
    -
  • Minus 1

  • - -
  • Minus 2

  • - -
  • Minus 3

  • -
- -

Ordered

- -

Tight:

- -
    -
  1. First
  2. -
  3. Second
  4. -
  5. Third
  6. -
- -

and:

- -
    -
  1. One
  2. -
  3. Two
  4. -
  5. Three
  6. -
- -

Loose using tabs:

- -
    -
  1. First

  2. - -
  3. Second

  4. - -
  5. Third

  6. -
- -

and using spaces:

- -
    -
  1. One

  2. - -
  3. Two

  4. - -
  5. Three

  6. -
- -

Multiple paragraphs:

- -
    -
  1. Item 1, graf one.

    - -

    Item 2. graf two. The quick brown fox jumped over the lazy dog's -back.

  2. - -
  3. Item 2.

  4. - -
  5. Item 3.

  6. -
- -

Nested

- -
    -
  • Tab - -
      -
    • Tab - -
        -
      • Tab
      • -
    • -
  • -
- -

Here's another:

- -
    -
  1. First
  2. -
  3. Second: - -
      -
    • Fee
    • -
    • Fie
    • -
    • Foe
    • -
  4. -
  5. Third
  6. -
- -

Same thing but with paragraphs:

- -
    -
  1. First

  2. - -
  3. Second:

    - -
      -
    • Fee
    • -
    • Fie
    • -
    • Foe
    • -
  4. - -
  5. Third

  6. -
- -

This was an error in Markdown 1.0.1:

- -
    -
  • this

    - -
      -
    • sub
    • -
    - -

    that

  • -
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Ordered and unordered lists.text b/vendor/github.com/russross/blackfriday/upskirtref/Ordered and unordered lists.text deleted file mode 100644 index 7f3b49777f2..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Ordered and unordered lists.text +++ /dev/null @@ -1,131 +0,0 @@ -## Unordered - -Asterisks tight: - -* asterisk 1 -* asterisk 2 -* asterisk 3 - - -Asterisks loose: - -* asterisk 1 - -* asterisk 2 - -* asterisk 3 - -* * * - -Pluses tight: - -+ Plus 1 -+ Plus 2 -+ Plus 3 - - -Pluses loose: - -+ Plus 1 - -+ Plus 2 - -+ Plus 3 - -* * * - - -Minuses tight: - -- Minus 1 -- Minus 2 -- Minus 3 - - -Minuses loose: - -- Minus 1 - -- Minus 2 - -- Minus 3 - - -## Ordered - -Tight: - -1. First -2. Second -3. Third - -and: - -1. One -2. Two -3. Three - - -Loose using tabs: - -1. First - -2. Second - -3. Third - -and using spaces: - -1. One - -2. Two - -3. Three - -Multiple paragraphs: - -1. Item 1, graf one. - - Item 2. graf two. The quick brown fox jumped over the lazy dog's - back. - -2. Item 2. - -3. Item 3. - - - -## Nested - -* Tab - * Tab - * Tab - -Here's another: - -1. First -2. Second: - * Fee - * Fie - * Foe -3. Third - -Same thing but with paragraphs: - -1. First - -2. Second: - * Fee - * Fie - * Foe - -3. Third - - -This was an error in Markdown 1.0.1: - -* this - - * sub - - that diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Strong and em together.html b/vendor/github.com/russross/blackfriday/upskirtref/Strong and em together.html deleted file mode 100644 index 71ec78c7092..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Strong and em together.html +++ /dev/null @@ -1,7 +0,0 @@ -

This is strong and em.

- -

So is this word.

- -

This is strong and em.

- -

So is this word.

diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Strong and em together.text b/vendor/github.com/russross/blackfriday/upskirtref/Strong and em together.text deleted file mode 100644 index 95ee690dbe2..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Strong and em together.text +++ /dev/null @@ -1,7 +0,0 @@ -***This is strong and em.*** - -So is ***this*** word. - -___This is strong and em.___ - -So is ___this___ word. diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Tabs.html b/vendor/github.com/russross/blackfriday/upskirtref/Tabs.html deleted file mode 100644 index 64006d96af9..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Tabs.html +++ /dev/null @@ -1,26 +0,0 @@ -
    -
  • this is a list item -indented with tabs

  • - -
  • this is a list item -indented with spaces

  • -
- -

Code:

- -
this code block is indented by one tab
-
- -

And:

- -
    this code block is indented by two tabs
-
- -

And:

- -
+   this is an example list item
-    indented with tabs
-
-+   this is an example list item
-    indented with spaces
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Tabs.text b/vendor/github.com/russross/blackfriday/upskirtref/Tabs.text deleted file mode 100644 index 589d1136e19..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Tabs.text +++ /dev/null @@ -1,21 +0,0 @@ -+ this is a list item - indented with tabs - -+ this is a list item - indented with spaces - -Code: - - this code block is indented by one tab - -And: - - this code block is indented by two tabs - -And: - - + this is an example list item - indented with tabs - - + this is an example list item - indented with spaces diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Tidyness.html b/vendor/github.com/russross/blackfriday/upskirtref/Tidyness.html deleted file mode 100644 index 9c45b69c211..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Tidyness.html +++ /dev/null @@ -1,9 +0,0 @@ -
-

A list within a blockquote:

- -
    -
  • asterisk 1
  • -
  • asterisk 2
  • -
  • asterisk 3
  • -
-
diff --git a/vendor/github.com/russross/blackfriday/upskirtref/Tidyness.text b/vendor/github.com/russross/blackfriday/upskirtref/Tidyness.text deleted file mode 100644 index 5f18b8da214..00000000000 --- a/vendor/github.com/russross/blackfriday/upskirtref/Tidyness.text +++ /dev/null @@ -1,5 +0,0 @@ -> A list within a blockquote: -> -> * asterisk 1 -> * asterisk 2 -> * asterisk 3 diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/add.go b/vendor/github.com/spf13/cobra/cobra/cmd/add.go deleted file mode 100644 index b89d4c4741d..00000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/add.go +++ /dev/null @@ -1,128 +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. - -package cmd - -import ( - "fmt" - "path/filepath" - "strings" - - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -func init() { - RootCmd.AddCommand(addCmd) -} - -var pName string - -// initialize Command -var addCmd = &cobra.Command{ - Use: "add [command name]", - Aliases: []string{"command"}, - Short: "Add a command to a Cobra Application", - Long: `Add (cobra add) will create a new command, with a license and -the appropriate structure for a Cobra-based CLI application, -and register it to its parent (default RootCmd). - -If you want your command to be public, pass in the command name -with an initial uppercase letter. - -Example: cobra add server -> resulting in a new cmd/server.go - `, - - Run: func(cmd *cobra.Command, args []string) { - if len(args) != 1 { - er("add needs a name for the command") - } - guessProjectPath() - createCmdFile(args[0]) - }, -} - -func init() { - addCmd.Flags().StringVarP(&pName, "parent", "p", "RootCmd", "name of parent command for this command") -} - -func parentName() string { - if !strings.HasSuffix(strings.ToLower(pName), "cmd") { - return pName + "Cmd" - } - - return pName -} - -func createCmdFile(cmdName string) { - lic := getLicense() - - template := `{{ comment .copyright }} -{{ comment .license }} - -package cmd - -import ( - "fmt" - - "github.com/spf13/cobra" -) - -// {{.cmdName}}Cmd represents the {{.cmdName}} command -var {{ .cmdName }}Cmd = &cobra.Command{ - Use: "{{ .cmdName }}", - Short: "A brief description of your command", - Long: ` + "`" + `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.` + "`" + `, - Run: func(cmd *cobra.Command, args []string) { - // TODO: Work your own magic here - fmt.Println("{{ .cmdName }} called") - }, -} - -func init() { - {{ .parentName }}.AddCommand({{ .cmdName }}Cmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // {{.cmdName}}Cmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // {{.cmdName}}Cmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") - -} -` - - var data map[string]interface{} - data = make(map[string]interface{}) - - data["copyright"] = copyrightLine() - data["license"] = lic.Header - data["appName"] = projectName() - data["viper"] = viper.GetBool("useViper") - data["parentName"] = parentName() - data["cmdName"] = cmdName - - err := writeTemplateToFile(filepath.Join(ProjectPath(), guessCmdDir()), cmdName+".go", template, data) - if err != nil { - er(err) - } - fmt.Println(cmdName, "created at", filepath.Join(ProjectPath(), guessCmdDir(), cmdName+".go")) -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/helpers.go b/vendor/github.com/spf13/cobra/cobra/cmd/helpers.go deleted file mode 100644 index f8b79b1fc0c..00000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/helpers.go +++ /dev/null @@ -1,347 +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. - -package cmd - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "strings" - "text/template" - "time" - - "github.com/spf13/viper" -) - -// var BaseDir = "" -// var AppName = "" -// var CommandDir = "" - -var funcMap template.FuncMap -var projectPath = "" -var inputPath = "" -var projectBase = "" - -// for testing only -var testWd = "" - -var cmdDirs = []string{"cmd", "cmds", "command", "commands"} - -func init() { - funcMap = template.FuncMap{ - "comment": commentifyString, - } -} - -func er(msg interface{}) { - fmt.Println("Error:", msg) - os.Exit(-1) -} - -// Check if a file or directory exists. -func exists(path string) (bool, error) { - _, err := os.Stat(path) - if err == nil { - return true, nil - } - if os.IsNotExist(err) { - return false, nil - } - return false, err -} - -func ProjectPath() string { - if projectPath == "" { - guessProjectPath() - } - - return projectPath -} - -// wrapper of the os package so we can test better -func getWd() (string, error) { - if testWd == "" { - return os.Getwd() - } - return testWd, nil -} - -func guessCmdDir() string { - guessProjectPath() - if b, _ := isEmpty(projectPath); b { - return "cmd" - } - - files, _ := filepath.Glob(projectPath + string(os.PathSeparator) + "c*") - for _, f := range files { - for _, c := range cmdDirs { - if f == c { - return c - } - } - } - - return "cmd" -} - -func guessImportPath() string { - guessProjectPath() - - if !strings.HasPrefix(projectPath, getSrcPath()) { - er("Cobra only supports project within $GOPATH") - } - - return filepath.ToSlash(filepath.Clean(strings.TrimPrefix(projectPath, getSrcPath()))) -} - -func getSrcPath() string { - return filepath.Join(os.Getenv("GOPATH"), "src") + string(os.PathSeparator) -} - -func projectName() string { - return filepath.Base(ProjectPath()) -} - -func guessProjectPath() { - // if no path is provided... assume CWD. - if inputPath == "" { - x, err := getWd() - if err != nil { - er(err) - } - - // inspect CWD - base := filepath.Base(x) - - // if we are in the cmd directory.. back up - for _, c := range cmdDirs { - if base == c { - projectPath = filepath.Dir(x) - return - } - } - - if projectPath == "" { - projectPath = filepath.Clean(x) - return - } - } - - srcPath := getSrcPath() - // if provided, inspect for logical locations - if strings.ContainsRune(inputPath, os.PathSeparator) { - if filepath.IsAbs(inputPath) || filepath.HasPrefix(inputPath, string(os.PathSeparator)) { - // if Absolute, use it - projectPath = filepath.Clean(inputPath) - return - } - // If not absolute but contains slashes, - // assuming it means create it from $GOPATH - count := strings.Count(inputPath, string(os.PathSeparator)) - - switch count { - // If only one directory deep, assume "github.com" - case 1: - projectPath = filepath.Join(srcPath, "github.com", inputPath) - return - case 2: - projectPath = filepath.Join(srcPath, inputPath) - return - default: - er("Unknown directory") - } - } else { - // hardest case.. just a word. - if projectBase == "" { - x, err := getWd() - if err == nil { - projectPath = filepath.Join(x, inputPath) - return - } - er(err) - } else { - projectPath = filepath.Join(srcPath, projectBase, inputPath) - return - } - } -} - -// isEmpty checks if a given path is empty. -func isEmpty(path string) (bool, error) { - if b, _ := exists(path); !b { - return false, fmt.Errorf("%q path does not exist", path) - } - fi, err := os.Stat(path) - if err != nil { - return false, err - } - if fi.IsDir() { - f, err := os.Open(path) - // FIX: Resource leak - f.close() should be called here by defer or is missed - // if the err != nil branch is taken. - defer f.Close() - if err != nil { - return false, err - } - list, _ := f.Readdir(-1) - // f.Close() - see bug fix above - return len(list) == 0, nil - } - return fi.Size() == 0, nil -} - -// isDir checks if a given path is a directory. -func isDir(path string) (bool, error) { - fi, err := os.Stat(path) - if err != nil { - return false, err - } - return fi.IsDir(), nil -} - -// dirExists checks if a path exists and is a directory. -func dirExists(path string) (bool, error) { - fi, err := os.Stat(path) - if err == nil && fi.IsDir() { - return true, nil - } - if os.IsNotExist(err) { - return false, nil - } - return false, err -} - -func writeTemplateToFile(path string, file string, template string, data interface{}) error { - filename := filepath.Join(path, file) - - r, err := templateToReader(template, data) - - if err != nil { - return err - } - - err = safeWriteToDisk(filename, r) - - if err != nil { - return err - } - return nil -} - -func writeStringToFile(path, file, text string) error { - filename := filepath.Join(path, file) - - r := strings.NewReader(text) - err := safeWriteToDisk(filename, r) - - if err != nil { - return err - } - return nil -} - -func templateToReader(tpl string, data interface{}) (io.Reader, error) { - tmpl := template.New("") - tmpl.Funcs(funcMap) - tmpl, err := tmpl.Parse(tpl) - - if err != nil { - return nil, err - } - buf := new(bytes.Buffer) - err = tmpl.Execute(buf, data) - - return buf, err -} - -// Same as WriteToDisk but checks to see if file/directory already exists. -func safeWriteToDisk(inpath string, r io.Reader) (err error) { - dir, _ := filepath.Split(inpath) - ospath := filepath.FromSlash(dir) - - if ospath != "" { - err = os.MkdirAll(ospath, 0777) // rwx, rw, r - if err != nil { - return - } - } - - ex, err := exists(inpath) - if err != nil { - return - } - if ex { - return fmt.Errorf("%v already exists", inpath) - } - - file, err := os.Create(inpath) - if err != nil { - return - } - defer file.Close() - - _, err = io.Copy(file, r) - return -} - -func getLicense() License { - l := whichLicense() - if l != "" { - if x, ok := Licenses[l]; ok { - return x - } - } - - return Licenses["apache"] -} - -func whichLicense() string { - // if explicitly flagged, use that - if userLicense != "" { - return matchLicense(userLicense) - } - - // if already present in the project, use that - // TODO: Inspect project for existing license - - // default to viper's setting - - return matchLicense(viper.GetString("license")) -} - -func copyrightLine() string { - author := viper.GetString("author") - year := time.Now().Format("2006") - - return "Copyright © " + year + " " + author -} - -func commentifyString(in string) string { - var newlines []string - lines := strings.Split(in, "\n") - for _, x := range lines { - if !strings.HasPrefix(x, "//") { - if x != "" { - newlines = append(newlines, "// "+x) - } else { - newlines = append(newlines, "//") - } - } else { - newlines = append(newlines, x) - } - } - return strings.Join(newlines, "\n") -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/init.go b/vendor/github.com/spf13/cobra/cobra/cmd/init.go deleted file mode 100644 index 342fb9ccdf5..00000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/init.go +++ /dev/null @@ -1,226 +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. - -package cmd - -import ( - "fmt" - "os" - "strings" - - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -func init() { - RootCmd.AddCommand(initCmd) -} - -// initialize Command -var initCmd = &cobra.Command{ - Use: "init [name]", - Aliases: []string{"initialize", "initialise", "create"}, - Short: "Initialize a Cobra Application", - Long: `Initialize (cobra init) will create a new application, with a license -and the appropriate structure for a Cobra-based CLI application. - - * If a name is provided, it will be created in the current directory; - * If no name is provided, the current directory will be assumed; - * If a relative path is provided, it will be created inside $GOPATH - (e.g. github.com/spf13/hugo); - * If an absolute path is provided, it will be created; - * If the directory already exists but is empty, it will be used. - -Init will not use an existing directory with contents.`, - - Run: func(cmd *cobra.Command, args []string) { - switch len(args) { - case 0: - inputPath = "" - - case 1: - inputPath = args[0] - - default: - er("init doesn't support more than 1 parameter") - } - guessProjectPath() - initializePath(projectPath) - }, -} - -func initializePath(path string) { - b, err := exists(path) - if err != nil { - er(err) - } - - if !b { // If path doesn't yet exist, create it - err := os.MkdirAll(path, os.ModePerm) - if err != nil { - er(err) - } - } else { // If path exists and is not empty don't use it - empty, err := exists(path) - if err != nil { - er(err) - } - if !empty { - er("Cobra will not create a new project in a non empty directory") - } - } - // We have a directory and it's empty.. Time to initialize it. - - createLicenseFile() - createMainFile() - createRootCmdFile() -} - -func createLicenseFile() { - lic := getLicense() - - template := lic.Text - - var data map[string]interface{} - data = make(map[string]interface{}) - - // Try to remove the email address, if any - data["copyright"] = strings.Split(copyrightLine(), " <")[0] - - err := writeTemplateToFile(ProjectPath(), "LICENSE", template, data) - _ = err - // if err != nil { - // er(err) - // } -} - -func createMainFile() { - lic := getLicense() - - template := `{{ comment .copyright }} -{{ comment .license }} - -package main - -import "{{ .importpath }}" - -func main() { - cmd.Execute() -} -` - var data map[string]interface{} - data = make(map[string]interface{}) - - data["copyright"] = copyrightLine() - data["license"] = lic.Header - data["importpath"] = guessImportPath() + "/" + guessCmdDir() - - err := writeTemplateToFile(ProjectPath(), "main.go", template, data) - _ = err - // if err != nil { - // er(err) - // } -} - -func createRootCmdFile() { - lic := getLicense() - - template := `{{ comment .copyright }} -{{ comment .license }} - -package cmd - -import ( - "fmt" - "os" - - "github.com/spf13/cobra" -{{ if .viper }} "github.com/spf13/viper" -{{ end }}) -{{if .viper}} -var cfgFile string -{{ end }} -// RootCmd represents the base command when called without any subcommands -var RootCmd = &cobra.Command{ - Use: "{{ .appName }}", - Short: "A brief description of your application", - Long: ` + "`" + `A longer description that spans multiple lines and likely contains -examples and usage of using your application. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.` + "`" + `, -// Uncomment the following line if your bare application -// has an action associated with it: -// Run: func(cmd *cobra.Command, args []string) { }, -} - -// Execute adds all child commands to the root command sets flags appropriately. -// This is called by main.main(). It only needs to happen once to the rootCmd. -func Execute() { - if err := RootCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(-1) - } -} - -func init() { -{{ if .viper }} cobra.OnInitialize(initConfig) - -{{ end }} // Here you will define your flags and configuration settings. - // Cobra supports Persistent Flags, which, if defined here, - // will be global for your application. -{{ if .viper }} - RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.{{ .appName }}.yaml)") -{{ else }} - // RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.{{ .appName }}.yaml)") -{{ end }} // Cobra also supports local flags, which will only run - // when this action is called directly. - RootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") -} -{{ if .viper }} -// initConfig reads in config file and ENV variables if set. -func initConfig() { - if cfgFile != "" { // enable ability to specify config file via flag - viper.SetConfigFile(cfgFile) - } - - viper.SetConfigName(".{{ .appName }}") // name of config file (without extension) - viper.AddConfigPath("$HOME") // adding home directory as first search path - viper.AutomaticEnv() // read in environment variables that match - - // If a config file is found, read it in. - if err := viper.ReadInConfig(); err == nil { - fmt.Println("Using config file:", viper.ConfigFileUsed()) - } -} -{{ end }}` - - var data map[string]interface{} - data = make(map[string]interface{}) - - data["copyright"] = copyrightLine() - data["license"] = lic.Header - data["appName"] = projectName() - data["viper"] = viper.GetBool("useViper") - - err := writeTemplateToFile(ProjectPath()+string(os.PathSeparator)+guessCmdDir(), "root.go", template, data) - if err != nil { - er(err) - } - - fmt.Println("Your Cobra application is ready at") - fmt.Println(ProjectPath()) - fmt.Println("Give it a try by going there and running `go run main.go`") - fmt.Println("Add commands to it by running `cobra add [cmdname]`") -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go b/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go deleted file mode 100644 index 5ad9c96ef18..00000000000 --- a/vendor/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/spf13/cobra/cobra/cmd/root.go b/vendor/github.com/spf13/cobra/cobra/cmd/root.go deleted file mode 100644 index dbe607beb5f..00000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/root.go +++ /dev/null @@ -1,84 +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. - -package cmd - -import ( - "fmt" - "os" - - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -var cfgFile string -var userLicense string - -// RootCmd represents the base command when called without any subcommands -var RootCmd = &cobra.Command{ - Use: "cobra", - Short: "A generator for Cobra based Applications", - Long: `Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, -} - -//Execute adds all child commands to the root command sets flags appropriately. -func Execute() { - if err := RootCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(-1) - } -} - -func init() { - cobra.OnInitialize(initConfig) - RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)") - RootCmd.PersistentFlags().StringVarP(&projectBase, "projectbase", "b", "", "base project directory, e.g. github.com/spf13/") - RootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "Author name for copyright attribution") - RootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "Name of license for the project (can provide `licensetext` in config)") - RootCmd.PersistentFlags().Bool("viper", true, "Use Viper for configuration") - viper.BindPFlag("author", RootCmd.PersistentFlags().Lookup("author")) - viper.BindPFlag("projectbase", RootCmd.PersistentFlags().Lookup("projectbase")) - viper.BindPFlag("useViper", RootCmd.PersistentFlags().Lookup("viper")) - viper.SetDefault("author", "NAME HERE ") - viper.SetDefault("license", "apache") - viper.SetDefault("licenseText", ` -// 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. -`) -} - -// Read in config file and ENV variables if set. -func initConfig() { - if cfgFile != "" { // enable ability to specify config file via flag - viper.SetConfigFile(cfgFile) - } - - viper.SetConfigName(".cobra") // name of config file (without extension) - viper.AddConfigPath("$HOME") // adding home directory as first search path - viper.AutomaticEnv() // read in environment variables that match - - // If a config file is found, read it in. - if err := viper.ReadInConfig(); err == nil { - fmt.Println("Using config file:", viper.ConfigFileUsed()) - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/main.go b/vendor/github.com/spf13/cobra/cobra/main.go deleted file mode 100644 index c3a9d9cb04c..00000000000 --- a/vendor/github.com/spf13/cobra/cobra/main.go +++ /dev/null @@ -1,20 +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. - -package main - -import "github.com/spf13/cobra/cobra/cmd" - -func main() { - cmd.Execute() -} diff --git a/vendor/github.com/spf13/pflag/verify/all.sh b/vendor/github.com/spf13/pflag/verify/all.sh deleted file mode 100644 index 739f89c0b4b..00000000000 --- a/vendor/github.com/spf13/pflag/verify/all.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -set -o errexit -set -o nounset -set -o pipefail - -ROOT=$(dirname "${BASH_SOURCE}")/.. - -# Some useful colors. -if [[ -z "${color_start-}" ]]; then - declare -r color_start="\033[" - declare -r color_red="${color_start}0;31m" - declare -r color_yellow="${color_start}0;33m" - declare -r color_green="${color_start}0;32m" - declare -r color_norm="${color_start}0m" -fi - -SILENT=true - -function is-excluded { - for e in $EXCLUDE; do - if [[ $1 -ef ${BASH_SOURCE} ]]; then - return - fi - if [[ $1 -ef "$ROOT/hack/$e" ]]; then - return - fi - done - return 1 -} - -while getopts ":v" opt; do - case $opt in - v) - SILENT=false - ;; - \?) - echo "Invalid flag: -$OPTARG" >&2 - exit 1 - ;; - esac -done - -if $SILENT ; then - echo "Running in the silent mode, run with -v if you want to see script logs." -fi - -EXCLUDE="all.sh" - -ret=0 -for t in `ls $ROOT/verify/*.sh` -do - if is-excluded $t ; then - echo "Skipping $t" - continue - fi - if $SILENT ; then - echo -e "Verifying $t" - if bash "$t" &> /dev/null; then - echo -e "${color_green}SUCCESS${color_norm}" - else - echo -e "${color_red}FAILED${color_norm}" - ret=1 - fi - else - bash "$t" || ret=1 - fi -done -exit $ret diff --git a/vendor/github.com/spf13/pflag/verify/gofmt.sh b/vendor/github.com/spf13/pflag/verify/gofmt.sh deleted file mode 100644 index f66acf803b5..00000000000 --- a/vendor/github.com/spf13/pflag/verify/gofmt.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -o errexit -set -o nounset -set -o pipefail - -ROOT=$(dirname "${BASH_SOURCE}")/.. - -pushd "${ROOT}" > /dev/null - -GOFMT=${GOFMT:-"gofmt"} -bad_files=$(find . -name '*.go' | xargs $GOFMT -s -l) -if [[ -n "${bad_files}" ]]; then - echo "!!! '$GOFMT' needs to be run on the following files: " - echo "${bad_files}" - exit 1 -fi - -# ex: ts=2 sw=2 et filetype=sh diff --git a/vendor/github.com/spf13/pflag/verify/golint.sh b/vendor/github.com/spf13/pflag/verify/golint.sh deleted file mode 100644 index 685c1778e59..00000000000 --- a/vendor/github.com/spf13/pflag/verify/golint.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -ROOT=$(dirname "${BASH_SOURCE}")/.. -GOLINT=${GOLINT:-"golint"} - -pushd "${ROOT}" > /dev/null - bad_files=$($GOLINT -min_confidence=0.9 ./...) - if [[ -n "${bad_files}" ]]; then - echo "!!! '$GOLINT' problems: " - echo "${bad_files}" - exit 1 - fi -popd > /dev/null - -# ex: ts=2 sw=2 et filetype=sh diff --git a/vendor/github.com/stretchr/objx/codegen/array-access.txt b/vendor/github.com/stretchr/objx/codegen/array-access.txt deleted file mode 100644 index 30602347512..00000000000 --- a/vendor/github.com/stretchr/objx/codegen/array-access.txt +++ /dev/null @@ -1,14 +0,0 @@ - case []{1}: - a := object.([]{1}) - if isSet { - a[index] = value.({1}) - } else { - if index >= len(a) { - if panics { - panic(fmt.Sprintf("objx: Index %d is out of range because the []{1} only contains %d items.", index, len(a))) - } - return nil - } else { - return a[index] - } - } diff --git a/vendor/github.com/stretchr/objx/codegen/index.html b/vendor/github.com/stretchr/objx/codegen/index.html deleted file mode 100644 index 379ffc3c0e4..00000000000 --- a/vendor/github.com/stretchr/objx/codegen/index.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - Codegen - - - - - -

- Template -

-

- Use {x} as a placeholder for each argument. -

- - -

- Arguments (comma separated) -

-

- One block per line -

- - -

- Output -

- - - - - - - - diff --git a/vendor/github.com/stretchr/objx/codegen/template.txt b/vendor/github.com/stretchr/objx/codegen/template.txt deleted file mode 100644 index b396900b8af..00000000000 --- a/vendor/github.com/stretchr/objx/codegen/template.txt +++ /dev/null @@ -1,286 +0,0 @@ -/* - {4} ({1} and []{1}) - -------------------------------------------------- -*/ - -// {4} gets the value as a {1}, returns the optionalDefault -// value or a system default object if the value is the wrong type. -func (v *Value) {4}(optionalDefault ...{1}) {1} { - if s, ok := v.data.({1}); ok { - return s - } - if len(optionalDefault) == 1 { - return optionalDefault[0] - } - return {3} -} - -// Must{4} gets the value as a {1}. -// -// Panics if the object is not a {1}. -func (v *Value) Must{4}() {1} { - return v.data.({1}) -} - -// {4}Slice gets the value as a []{1}, returns the optionalDefault -// value or nil if the value is not a []{1}. -func (v *Value) {4}Slice(optionalDefault ...[]{1}) []{1} { - if s, ok := v.data.([]{1}); ok { - return s - } - if len(optionalDefault) == 1 { - return optionalDefault[0] - } - return nil -} - -// Must{4}Slice gets the value as a []{1}. -// -// Panics if the object is not a []{1}. -func (v *Value) Must{4}Slice() []{1} { - return v.data.([]{1}) -} - -// Is{4} gets whether the object contained is a {1} or not. -func (v *Value) Is{4}() bool { - _, ok := v.data.({1}) - return ok -} - -// Is{4}Slice gets whether the object contained is a []{1} or not. -func (v *Value) Is{4}Slice() bool { - _, ok := v.data.([]{1}) - return ok -} - -// Each{4} calls the specified callback for each object -// in the []{1}. -// -// Panics if the object is the wrong type. -func (v *Value) Each{4}(callback func(int, {1}) bool) *Value { - - for index, val := range v.Must{4}Slice() { - carryon := callback(index, val) - if carryon == false { - break - } - } - - return v - -} - -// Where{4} uses the specified decider function to select items -// from the []{1}. The object contained in the result will contain -// only the selected items. -func (v *Value) Where{4}(decider func(int, {1}) bool) *Value { - - var selected []{1} - - v.Each{4}(func(index int, val {1}) bool { - shouldSelect := decider(index, val) - if shouldSelect == false { - selected = append(selected, val) - } - return true - }) - - return &Value{data:selected} - -} - -// Group{4} uses the specified grouper function to group the items -// keyed by the return of the grouper. The object contained in the -// result will contain a map[string][]{1}. -func (v *Value) Group{4}(grouper func(int, {1}) string) *Value { - - groups := make(map[string][]{1}) - - v.Each{4}(func(index int, val {1}) bool { - group := grouper(index, val) - if _, ok := groups[group]; !ok { - groups[group] = make([]{1}, 0) - } - groups[group] = append(groups[group], val) - return true - }) - - return &Value{data:groups} - -} - -// Replace{4} uses the specified function to replace each {1}s -// by iterating each item. The data in the returned result will be a -// []{1} containing the replaced items. -func (v *Value) Replace{4}(replacer func(int, {1}) {1}) *Value { - - arr := v.Must{4}Slice() - replaced := make([]{1}, len(arr)) - - v.Each{4}(func(index int, val {1}) bool { - replaced[index] = replacer(index, val) - return true - }) - - return &Value{data:replaced} - -} - -// Collect{4} uses the specified collector function to collect a value -// for each of the {1}s in the slice. The data returned will be a -// []interface{}. -func (v *Value) Collect{4}(collector func(int, {1}) interface{}) *Value { - - arr := v.Must{4}Slice() - collected := make([]interface{}, len(arr)) - - v.Each{4}(func(index int, val {1}) bool { - collected[index] = collector(index, val) - return true - }) - - return &Value{data:collected} -} - -// ************************************************************ -// TESTS -// ************************************************************ - -func Test{4}(t *testing.T) { - - val := {1}( {2} ) - m := map[string]interface{}{"value": val, "nothing": nil} - assert.Equal(t, val, New(m).Get("value").{4}()) - assert.Equal(t, val, New(m).Get("value").Must{4}()) - assert.Equal(t, {1}({3}), New(m).Get("nothing").{4}()) - assert.Equal(t, val, New(m).Get("nothing").{4}({2})) - - assert.Panics(t, func() { - New(m).Get("age").Must{4}() - }) - -} - -func Test{4}Slice(t *testing.T) { - - val := {1}( {2} ) - m := map[string]interface{}{"value": []{1}{ val }, "nothing": nil} - assert.Equal(t, val, New(m).Get("value").{4}Slice()[0]) - assert.Equal(t, val, New(m).Get("value").Must{4}Slice()[0]) - assert.Equal(t, []{1}(nil), New(m).Get("nothing").{4}Slice()) - assert.Equal(t, val, New(m).Get("nothing").{4}Slice( []{1}{ {1}({2}) } )[0]) - - assert.Panics(t, func() { - New(m).Get("nothing").Must{4}Slice() - }) - -} - -func TestIs{4}(t *testing.T) { - - var v *Value - - v = &Value{data: {1}({2})} - assert.True(t, v.Is{4}()) - - v = &Value{data: []{1}{ {1}({2}) }} - assert.True(t, v.Is{4}Slice()) - -} - -func TestEach{4}(t *testing.T) { - - v := &Value{data: []{1}{ {1}({2}), {1}({2}), {1}({2}), {1}({2}), {1}({2}) }} - count := 0 - replacedVals := make([]{1}, 0) - assert.Equal(t, v, v.Each{4}(func(i int, val {1}) bool { - - count++ - replacedVals = append(replacedVals, val) - - // abort early - if i == 2 { - return false - } - - return true - - })) - - assert.Equal(t, count, 3) - assert.Equal(t, replacedVals[0], v.Must{4}Slice()[0]) - assert.Equal(t, replacedVals[1], v.Must{4}Slice()[1]) - assert.Equal(t, replacedVals[2], v.Must{4}Slice()[2]) - -} - -func TestWhere{4}(t *testing.T) { - - v := &Value{data: []{1}{ {1}({2}), {1}({2}), {1}({2}), {1}({2}), {1}({2}), {1}({2}) }} - - selected := v.Where{4}(func(i int, val {1}) bool { - return i%2==0 - }).Must{4}Slice() - - assert.Equal(t, 3, len(selected)) - -} - -func TestGroup{4}(t *testing.T) { - - v := &Value{data: []{1}{ {1}({2}), {1}({2}), {1}({2}), {1}({2}), {1}({2}), {1}({2}) }} - - grouped := v.Group{4}(func(i int, val {1}) string { - return fmt.Sprintf("%v", i%2==0) - }).data.(map[string][]{1}) - - assert.Equal(t, 2, len(grouped)) - assert.Equal(t, 3, len(grouped["true"])) - assert.Equal(t, 3, len(grouped["false"])) - -} - -func TestReplace{4}(t *testing.T) { - - v := &Value{data: []{1}{ {1}({2}), {1}({2}), {1}({2}), {1}({2}), {1}({2}), {1}({2}) }} - - rawArr := v.Must{4}Slice() - - replaced := v.Replace{4}(func(index int, val {1}) {1} { - if index < len(rawArr)-1 { - return rawArr[index+1] - } - return rawArr[0] - }) - - replacedArr := replaced.Must{4}Slice() - if assert.Equal(t, 6, len(replacedArr)) { - assert.Equal(t, replacedArr[0], rawArr[1]) - assert.Equal(t, replacedArr[1], rawArr[2]) - assert.Equal(t, replacedArr[2], rawArr[3]) - assert.Equal(t, replacedArr[3], rawArr[4]) - assert.Equal(t, replacedArr[4], rawArr[5]) - assert.Equal(t, replacedArr[5], rawArr[0]) - } - -} - -func TestCollect{4}(t *testing.T) { - - v := &Value{data: []{1}{ {1}({2}), {1}({2}), {1}({2}), {1}({2}), {1}({2}), {1}({2}) }} - - collected := v.Collect{4}(func(index int, val {1}) interface{} { - return index - }) - - collectedArr := collected.MustInterSlice() - if assert.Equal(t, 6, len(collectedArr)) { - assert.Equal(t, collectedArr[0], 0) - assert.Equal(t, collectedArr[1], 1) - assert.Equal(t, collectedArr[2], 2) - assert.Equal(t, collectedArr[3], 3) - assert.Equal(t, collectedArr[4], 4) - assert.Equal(t, collectedArr[5], 5) - } - -} diff --git a/vendor/github.com/stretchr/objx/codegen/types_list.txt b/vendor/github.com/stretchr/objx/codegen/types_list.txt deleted file mode 100644 index 069d43d8ecf..00000000000 --- a/vendor/github.com/stretchr/objx/codegen/types_list.txt +++ /dev/null @@ -1,20 +0,0 @@ -Interface,interface{},"something",nil,Inter -Map,map[string]interface{},map[string]interface{}{"name":"Tyler"},nil,MSI -ObjxMap,(Map),New(1),New(nil),ObjxMap -Bool,bool,true,false,Bool -String,string,"hello","",Str -Int,int,1,0,Int -Int8,int8,1,0,Int8 -Int16,int16,1,0,Int16 -Int32,int32,1,0,Int32 -Int64,int64,1,0,Int64 -Uint,uint,1,0,Uint -Uint8,uint8,1,0,Uint8 -Uint16,uint16,1,0,Uint16 -Uint32,uint32,1,0,Uint32 -Uint64,uint64,1,0,Uint64 -Uintptr,uintptr,1,0,Uintptr -Float32,float32,1,0,Float32 -Float64,float64,1,0,Float64 -Complex64,complex64,1,0,Complex64 -Complex128,complex128,1,0,Complex128 diff --git a/vendor/github.com/syndtr/gocapability/capability/enumgen/gen.go b/vendor/github.com/syndtr/gocapability/capability/enumgen/gen.go deleted file mode 100644 index 4c733809b1b..00000000000 --- a/vendor/github.com/syndtr/gocapability/capability/enumgen/gen.go +++ /dev/null @@ -1,92 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/token" - "io/ioutil" - "log" - "os" - "strings" -) - -const fileName = "enum.go" -const genName = "enum_gen.go" - -type generator struct { - buf bytes.Buffer - caps []string -} - -func (g *generator) writeHeader() { - g.buf.WriteString("// generated file; DO NOT EDIT - use go generate in directory with source\n") - g.buf.WriteString("\n") - g.buf.WriteString("package capability") -} - -func (g *generator) writeStringFunc() { - g.buf.WriteString("\n") - g.buf.WriteString("func (c Cap) String() string {\n") - g.buf.WriteString("switch c {\n") - for _, cap := range g.caps { - fmt.Fprintf(&g.buf, "case %s:\n", cap) - fmt.Fprintf(&g.buf, "return \"%s\"\n", strings.ToLower(cap[4:])) - } - g.buf.WriteString("}\n") - g.buf.WriteString("return \"unknown\"\n") - g.buf.WriteString("}\n") -} - -func (g *generator) writeListFunc() { - g.buf.WriteString("\n") - g.buf.WriteString("// List returns list of all supported capabilities\n") - g.buf.WriteString("func List() []Cap {\n") - g.buf.WriteString("return []Cap{\n") - for _, cap := range g.caps { - fmt.Fprintf(&g.buf, "%s,\n", cap) - } - g.buf.WriteString("}\n") - g.buf.WriteString("}\n") -} - -func main() { - fs := token.NewFileSet() - parsedFile, err := parser.ParseFile(fs, fileName, nil, 0) - if err != nil { - log.Fatal(err) - } - var caps []string - for _, decl := range parsedFile.Decls { - decl, ok := decl.(*ast.GenDecl) - if !ok || decl.Tok != token.CONST { - continue - } - for _, spec := range decl.Specs { - vspec := spec.(*ast.ValueSpec) - name := vspec.Names[0].Name - if strings.HasPrefix(name, "CAP_") { - caps = append(caps, name) - } - } - } - g := &generator{caps: caps} - g.writeHeader() - g.writeStringFunc() - g.writeListFunc() - src, err := format.Source(g.buf.Bytes()) - if err != nil { - fmt.Println("generated invalid Go code") - fmt.Println(g.buf.String()) - log.Fatal(err) - } - fi, err := os.Stat(fileName) - if err != nil { - log.Fatal(err) - } - if err := ioutil.WriteFile(genName, src, fi.Mode().Perm()); err != nil { - log.Fatal(err) - } -} diff --git a/vendor/github.com/vmware/govmomi/event/helper.go b/vendor/github.com/vmware/govmomi/event/helper.go deleted file mode 100644 index c3f5ffaa8d7..00000000000 --- a/vendor/github.com/vmware/govmomi/event/helper.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Copyright (c) 2016 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 ( - "fmt" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/property" - "github.com/vmware/govmomi/view" - "github.com/vmware/govmomi/vim25/types" -) - -func multipleObjectEvents(ctx context.Context, m Manager, objects []types.ManagedObjectReference, pageSize int32, tail bool, force bool, prop []string, f func([]types.BaseEvent) error) error { - // create an EventHistoryCollector for each object - var collectors []types.ManagedObjectReference - for _, o := range objects { - 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, pageSize) - if err != nil { - return err - } - - collectors = append(collectors, collector.Reference()) - } - - // create and populate a ListView - viewMgr := view.NewManager(m.Client()) - listView, err := viewMgr.CreateListView(ctx, collectors) - if err != nil { - return err - } - count := 0 - // Retrieve the property from the objects in the ListView - return property.WaitForView(ctx, property.DefaultCollector(m.Client()), listView.Reference(), collectors[0], prop, func(pc []types.PropertyChange) bool { - for _, u := range pc { - if u.Name != prop[0] { - continue - } - if u.Val == nil { - continue - } - f(u.Val.(types.ArrayOfEvent).Event) - } - count++ - if count == len(collectors) && !tail { - return true - } - return false - }) - -} - -func singleObjectEvents(ctx context.Context, m Manager, object types.ManagedObjectReference, pageSize int32, tail bool, force bool, prop []string, f func([]types.BaseEvent) error) error { - filter := types.EventFilterSpec{ - Entity: &types.EventFilterSpecByEntity{ - Entity: object, - Recursion: types.EventFilterSpecRecursionOptionAll, - }, - } - - collector, err := m.CreateCollectorForEvents(ctx, filter) - if err != nil { - return fmt.Errorf("[%#v] %s", object, err) - } - defer collector.Destroy(ctx) - - err = collector.SetPageSize(ctx, pageSize) - if err != nil { - return err - } - - return property.Wait(ctx, property.DefaultCollector(m.Client()), collector.Reference(), prop, func(pc []types.PropertyChange) bool { - for _, u := range pc { - if u.Name != prop[0] { - continue - } - if u.Val == nil { - continue - } - f(u.Val.(types.ArrayOfEvent).Event) - - } - if !tail { - return true - } - return false - }) -} 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 f58a3be0e8e..00000000000 --- 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 int32) ([]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 int32) ([]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 946dad14270..00000000000 --- a/vendor/github.com/vmware/govmomi/event/manager.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. -*/ - -package event - -import ( - "fmt" - "reflect" - "sync" - - "github.com/vmware/govmomi/object" - "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 { - object.Common - - eventCategory map[string]string - eventCategoryMu *sync.Mutex - maxObjects int -} - -func NewManager(c *vim25.Client) *Manager { - m := Manager{ - Common: object.NewCommon(c, *c.ServiceContent.EventManager), - - eventCategory: make(map[string]string), - eventCategoryMu: new(sync.Mutex), - maxObjects: 10, - } - - return &m -} - -func (m Manager) CreateCollectorForEvents(ctx context.Context, filter types.EventFilterSpec) (*HistoryCollector, error) { - req := types.CreateCollectorForEvents{ - This: m.Common.Reference(), - Filter: filter, - } - - res, err := methods.CreateCollectorForEvents(ctx, m.Client(), &req) - if err != nil { - return nil, err - } - - return NewHistoryCollector(m.Client(), res.Returnval), nil -} - -func (m Manager) LogUserEvent(ctx context.Context, entity types.ManagedObjectReference, msg string) error { - req := types.LogUserEvent{ - This: m.Common.Reference(), - Entity: entity, - Msg: msg, - } - - _, err := methods.LogUserEvent(ctx, m.Client(), &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.Common.Reference(), - EventToPost: eventToPost, - TaskInfo: &taskInfo, - } - - _, err := methods.PostEvent(ctx, m.Client(), &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.Common.Reference(), - Filter: filter, - } - - res, err := methods.QueryEvents(ctx, m.Client(), &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.Common.Reference(), - EventTypeId: eventTypeID, - } - - res, err := methods.RetrieveArgumentDescription(ctx, m.Client(), &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.Client()).RetrieveOne(ctx, m.Common.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 -} - -// Get the events from the specified object(s) and optionanlly tail the event stream -func (m Manager) Events(ctx context.Context, objects []types.ManagedObjectReference, pageSize int32, tail bool, force bool, f func([]types.BaseEvent) error) error { - - if len(objects) >= m.maxObjects && !force { - return fmt.Errorf("Maximum number of objects to monitor (%d) exceeded, refine search \n", m.maxObjects) - } - - // property that will be monitored - prop := []string{"latestPage"} - - // call to helper functions to reduce the number of temporary objects - if len(objects) > 1 { - return multipleObjectEvents(ctx, m, objects, pageSize, tail, force, prop, f) - } - - return singleObjectEvents(ctx, m, objects[0], pageSize, tail, force, prop, f) - -} 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 ac87b0eda08..00000000000 --- 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 5a76adfa940..00000000000 --- 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 26a4f147745..00000000000 --- 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 6cdeaae5a35..00000000000 --- 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 8373fcf82a1..00000000000 --- 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 d4982a23df0..00000000000 --- a/vendor/github.com/vmware/govmomi/gen/gen_from_vmodl.rb +++ /dev/null @@ -1,217 +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" - type = "int32" - 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 5004cfd0ff0..00000000000 --- 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 432d0709c16..00000000000 --- a/vendor/github.com/vmware/govmomi/gen/vim_wsdl.rb +++ /dev/null @@ -1,803 +0,0 @@ -# Copyright (c) 2014-2016 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" or ns == "internalvim25" or ns == "internalreflect" - end - - def vim_type(t = self.type) - ns, t = t.split(":", 2) - if ns != "vim25" and ns != "internalvim25" and ns != "internalreflect" - raise - end - 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 pointer_type? - ["UnitNumber"].include?(var_name) - end - - def var_type - t = self.type - prefix = "" - - prefix += "[]" if slice? - - if t =~ /^xsd:(.*)$/ - t = $1 - case t - when "string" - when "int" - if pointer_type? - prefix += "*" - self.need_omitempty = false - end - t = "int32" - 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 - - imports.each do |i| - i.validate_assumptions! - end - - includes.each do |i| - i.validate_assumptions! - end - end - - def types - return to_enum(:types) unless block_given? - - imports.each do |i| - i.types do |t| - yield t - end - end - - 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 imports - @imports ||= @xml.root.xpath(".//xmlns:import").map do |n| - Schema.new(WSDL.read n["schemaLocation"]) - 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 namespace - type = @operation_node.at_xpath("./xmlns:input").attr("message") - keep_ns(type) - end - - def remove_ns(x) - ns, x = x.split(":", 2) - if ns != "vim25" and ns != "internalvim25" and ns != "internalreflect" - raise - end - x - end - - def keep_ns(x) - ns, x = x.split(":", 2) - if ns != "vim25" and ns != "internalvim25" and ns != "internalreflect" - raise - end - ns - 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 - -* `GOVC_VIM_NAMESPACE`: Vim namespace defaults to `urn:vim25` - -* `GOVC_VIM_VERSION`: Vim version defaults to `6.0` - -## 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) - -* [Emacs govc package](./emacs) - -## 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 c0e60b661e2..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/about/command.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright (c) 2014-2016 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 5e17a79a8ce..00000000000 --- 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 2b33edcf6d7..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/cli/command.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright (c) 2014-2016 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 a20fc3ad0eb..00000000000 --- 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 027e0c25424..00000000000 --- 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 ea21a27dc29..00000000000 --- 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 3d92f01f0be..00000000000 --- 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 2b2065432db..00000000000 --- 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 eed333bb0c9..00000000000 --- 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 7e206ade48d..00000000000 --- 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 8ed3f1380b4..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/create.go +++ /dev/null @@ -1,273 +0,0 @@ -/* -Copyright (c) 2015-2016 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 27bfa93c8cb..00000000000 --- 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 6e9dd79971d..00000000000 --- 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 694a81e6dd9..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/datastore/ls.go +++ /dev/null @@ -1,232 +0,0 @@ -/* -Copyright (c) 2014-2016 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 cfa7e393317..00000000000 --- 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 023ef393e6d..00000000000 --- 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 772803446b6..00000000000 --- 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 09ef57d2fac..00000000000 --- 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 77d3d8dcd62..00000000000 --- 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 268acacbf1e..00000000000 --- 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 122789a93d8..00000000000 --- 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 ea8a161a8b1..00000000000 --- 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 cd4532ddcd6..00000000000 --- 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 65f93aa2bc8..00000000000 --- 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 fc23086216e..00000000000 --- 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 36b81961698..00000000000 --- 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 a2271ea6da5..00000000000 --- 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 213db692042..00000000000 --- 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 7258181745b..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/info.go +++ /dev/null @@ -1,185 +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 - *flags.NetworkFlag -} - -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) - - cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx) - cmd.NetworkFlag.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 - } - if err := cmd.NetworkFlag.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 cmd.NetworkFlag.IsSet() { - net, err := cmd.Network() - if err != nil { - return err - } - - backing, err := net.EthernetCardBackingInfo(context.TODO()) - if err != nil { - return err - } - - devices = devices.SelectByBackingInfo(backing) - } - - 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)) - if d.UnitNumber != nil { - fmt.Fprintf(tw, " Unit number:\t%d\n", *d.UnitNumber) - } else { - fmt.Fprintf(tw, " Unit number:\t\n") - } - } - } - - 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 c4eafa3180f..00000000000 --- 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 0e03b7197fd..00000000000 --- 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 276391da85a..00000000000 --- 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 564ef27ab2e..00000000000 --- 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 939fc420bb4..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/device/serial/connect.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -Copyright (c) 2014-2016 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 108006fc11e..00000000000 --- 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 671b7e13b80..00000000000 --- 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 cab77f6bc7c..00000000000 --- 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 9772d2936ed..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/dvs/portgroup/add.go +++ /dev/null @@ -1,108 +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, "|"))) - - cmd.DVPortgroupConfigSpec.NumPorts = 128 // default - f.Var(flags.NewInt32(&cmd.DVPortgroupConfigSpec.NumPorts), "nports", "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/dvs/portgroup/info.go b/vendor/github.com/vmware/govmomi/govc/dvs/portgroup/info.go deleted file mode 100644 index 9a6d3172968..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/dvs/portgroup/info.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -Copyright (c) 2015-2016 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" - - "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/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type info struct { - *flags.DatacenterFlag - - pg string - active bool - connected bool - inside bool - uplinkPort bool - vlanID int - count uint -} - -func init() { - cli.Register("dvs.portgroup.info", &info{}) -} - -func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) { - cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) - cmd.DatacenterFlag.Register(ctx, f) - - f.StringVar(&cmd.pg, "pg", "", "Distributed Virtual Portgroup") - f.BoolVar(&cmd.active, "active", false, "Filter by port active or inactive status") - f.BoolVar(&cmd.connected, "connected", false, "Filter by port connected or disconnected status") - f.BoolVar(&cmd.inside, "inside", true, "Filter by port inside or outside status") - f.BoolVar(&cmd.uplinkPort, "uplinkPort", false, "Filter for uplink ports") - f.IntVar(&cmd.vlanID, "vlan", 0, "Filter by VLAN ID (0 = unfiltered)") - f.UintVar(&cmd.count, "count", 0, "Number of matches to return (0 = unlimited)") -} - -func (cmd *info) Process(ctx context.Context) error { - if err := cmd.ClientFlag.Process(ctx); err != nil { - return err - } - - return nil -} - -func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error { - if f.NArg() != 1 { - return flag.ErrHelp - } - - client, err := cmd.Client() - if err != nil { - return err - } - - finder, err := cmd.Finder() - if err != nil { - return err - } - - // Retrieve DVS reference - net, err := finder.Network(ctx, f.Arg(0)) - if err != nil { - return err - } - - // Convert to DVS object type - dvs, ok := net.(*object.DistributedVirtualSwitch) - if !ok { - return fmt.Errorf("%s (%s) is not a DVS", f.Arg(0), net.Reference().Type) - } - - // Set base search criteria - criteria := types.DistributedVirtualSwitchPortCriteria{ - Connected: types.NewBool(cmd.connected), - Active: types.NewBool(cmd.active), - UplinkPort: types.NewBool(cmd.uplinkPort), - Inside: types.NewBool(cmd.inside), - } - - // If a distributed virtual portgroup path is set, then add its portgroup key to the base criteria - if len(cmd.pg) > 0 { - // Retrieve distributed virtual portgroup reference - net, err = finder.Network(ctx, cmd.pg) - if err != nil { - return err - } - - // Convert distributed virtual portgroup object type - dvpg, ok := net.(*object.DistributedVirtualPortgroup) - if !ok { - return fmt.Errorf("%s (%s) is not a DVPG", cmd.pg, net.Reference().Type) - } - - // Obtain portgroup key property - var dvp mo.DistributedVirtualPortgroup - if err := dvpg.Properties(ctx, dvpg.Reference(), []string{"key"}, &dvp); err != nil { - return err - } - - // Add portgroup key to port search criteria - criteria.PortgroupKey = []string{dvp.Key} - } - - // Prepare request - req := types.FetchDVPorts{ - This: dvs.Reference(), - Criteria: &criteria, - } - - // Fetch ports - res, err := methods.FetchDVPorts(ctx, client, &req) - if err != nil { - return err - } - - var returnedPorts uint - - // Iterate over returned ports - for _, port := range res.Returnval { - portConfigSetting := port.Config.Setting.(*types.VMwareDVSPortSetting) - portVlan := portConfigSetting.Vlan.(*types.VmwareDistributedVirtualSwitchVlanIdSpec) - portVlanID := portVlan.VlanId - - // Show port info if: VLAN ID is not defined, or VLAN ID matches requested VLAN - if cmd.vlanID == 0 || portVlanID == int32(cmd.vlanID) { - returnedPorts++ - - fmt.Printf("PortgroupKey: %s\n", port.PortgroupKey) - fmt.Printf("DvsUuid: %s\n", port.DvsUuid) - fmt.Printf("VlanId: %d\n", portVlanID) - fmt.Printf("PortKey: %s\n\n", port.Key) - - // If we are limiting the count and have reached the count, then stop returning output - if cmd.count > 0 && returnedPorts == cmd.count { - break - } - } - } - - return nil -} 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 56179efce32..00000000000 --- 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 aa7cf639cfc..00000000000 --- 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 0508993db4e..00000000000 --- 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 67803356c20..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/emacs/README.md +++ /dev/null @@ -1,226 +0,0 @@ -# govc.el - -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 ;` 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 -C | Console screenshot via `govc-vm-screen` 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 fe3896a0f0f..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/emacs/govc.el +++ /dev/null @@ -1,1261 +0,0 @@ -;;; govc.el --- Interface to govc for managing VMware ESXi and vCenter - -;; Author: The govc developers -;; URL: https://github.com/vmware/govmomi/tree/master/govc/emacs -;; Keywords: convenience -;; Version: 0.1.0 -;; Package-Requires: ((emacs "24.3") (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 ;" - "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 ;' 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 b693b4f21b0..00000000000 --- 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 add62185e5d..00000000000 --- 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 c43ee5dc393..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/events/command.go +++ /dev/null @@ -1,120 +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 int32 - Tail bool - Force bool -} - -func init() { - // initialize with the maximum allowed objects set - 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) - - cmd.Max = 25 // default - f.Var(flags.NewInt32(&cmd.Max), "n", "Output the last N events") - f.BoolVar(&cmd.Tail, "f", false, "Tail event stream") - f.BoolVar(&cmd.Force, "force", false, "Force event collection: use with CAUTION ") -} - -func (cmd *events) Process(ctx context.Context) error { - if err := cmd.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil -} - -func (cmd *events) printEvents(ctx context.Context, page []types.BaseEvent, m *event.Manager) error { - event.Sort(page) - for _, e := range page { - 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 -} - -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 - } - - objs, err := cmd.ManagedObjects(ctx, f.Args()) - if err != nil { - return err - } - - if len(objs) > 0 { - // need an event manager - m := event.NewManager(c) - - // get the event stream - err := m.Events(ctx, objs, cmd.Max, cmd.Tail, cmd.Force, func(ee []types.BaseEvent) error { - err = cmd.printEvents(ctx, ee, m) - if err != nil { - return err - } - return nil - }) - - if err != nil { - return err - } - - } - - 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 60910e9fb3a..00000000000 --- 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 19e4d6b21e5..00000000000 --- 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 5086f347f74..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/datastore.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright (c) 2014-2016 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" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type DatastoreFlag struct { - common - - *DatacenterFlag - - Name string - - ds *object.Datastore -} - -var datastoreFlagKey = flagKey("datastore") - -// NewCustomDatastoreFlag creates and returns a new DatastoreFlag without -// trying to retrieve an existing one from the specified context. -func NewCustomDatastoreFlag(ctx context.Context) (*DatastoreFlag, context.Context) { - v := &DatastoreFlag{} - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - return v, ctx -} - -func NewDatastoreFlag(ctx context.Context) (*DatastoreFlag, context.Context) { - if v := ctx.Value(datastoreFlagKey); v != nil { - return v.(*DatastoreFlag), ctx - } - - v, ctx := NewCustomDatastoreFlag(ctx) - ctx = context.WithValue(ctx, datastoreFlagKey, v) - return v, ctx -} - -func (f *DatastoreFlag) Register(ctx context.Context, fs *flag.FlagSet) { - f.RegisterOnce(func() { - f.DatacenterFlag.Register(ctx, fs) - - env := "GOVC_DATASTORE" - value := os.Getenv(env) - usage := fmt.Sprintf("Datastore [%s]", env) - fs.StringVar(&f.Name, "ds", value, usage) - }) -} - -func (f *DatastoreFlag) Process(ctx context.Context) error { - return f.ProcessOnce(func() error { - if err := f.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil - }) -} - -func (f *DatastoreFlag) Datastore() (*object.Datastore, error) { - if f.ds != nil { - return f.ds, nil - } - - finder, err := f.Finder() - if err != nil { - return nil, err - } - - if f.ds, err = finder.DatastoreOrDefault(context.TODO(), f.Name); err != nil { - return nil, err - } - - return f.ds, nil -} - -func (f *DatastoreFlag) DatastorePath(name string) (string, error) { - ds, err := f.Datastore() - if err != nil { - return "", err - } - - return ds.Path(name), nil -} - -func (f *DatastoreFlag) DatastoreURL(path string) (*url.URL, error) { - dc, err := f.Datacenter() - if err != nil { - return nil, err - } - - ds, err := f.Datastore() - if err != nil { - return nil, err - } - - u, err := ds.URL(context.TODO(), dc, path) - if err != nil { - return nil, err - } - - return u, nil -} - -func (f *DatastoreFlag) Stat(ctx context.Context, file string) (types.BaseFileInfo, error) { - ds, err := f.Datastore() - if err != nil { - return nil, err - } - - return ds.Stat(ctx, file) - -} 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 395a2619de3..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/debug.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright (c) 2014-2016 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 e854f6dcdbb..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/empty.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (c) 2014-2016 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/folder.go b/vendor/github.com/vmware/govmomi/govc/flags/folder.go deleted file mode 100644 index 5b639e8c168..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/folder.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (c) 2014-2016 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 FolderFlag struct { - common - - *DatacenterFlag - - name string - folder *object.Folder -} - -var folderFlagKey = flagKey("folder") - -func NewFolderFlag(ctx context.Context) (*FolderFlag, context.Context) { - if v := ctx.Value(folderFlagKey); v != nil { - return v.(*FolderFlag), ctx - } - - v := &FolderFlag{} - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - ctx = context.WithValue(ctx, folderFlagKey, v) - return v, ctx -} - -func (flag *FolderFlag) Register(ctx context.Context, f *flag.FlagSet) { - flag.RegisterOnce(func() { - flag.DatacenterFlag.Register(ctx, f) - - env := "GOVC_FOLDER" - value := os.Getenv(env) - usage := fmt.Sprintf("Folder [%s]", env) - f.StringVar(&flag.name, "folder", value, usage) - }) -} - -func (flag *FolderFlag) Process(ctx context.Context) error { - return flag.ProcessOnce(func() error { - if err := flag.DatacenterFlag.Process(ctx); err != nil { - return err - } - return nil - }) -} - -func (flag *FolderFlag) Folder() (*object.Folder, error) { - if flag.folder != nil { - return flag.folder, nil - } - - finder, err := flag.Finder() - if err != nil { - return nil, err - } - - if flag.folder, err = finder.FolderOrDefault(context.TODO(), flag.name); err != nil { - return nil, err - } - - return flag.folder, 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 be39dbd0acc..00000000000 --- 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 a0d847239f5..00000000000 --- 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/int32.go b/vendor/github.com/vmware/govmomi/govc/flags/int32.go deleted file mode 100644 index 5ab58aa0476..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/int32.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright (c) 2016 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" -) - -// This flag type is internal to stdlib: -// https://github.com/golang/go/blob/master/src/cmd/internal/obj/flag.go -type int32Value int32 - -func (i *int32Value) Set(s string) error { - v, err := strconv.ParseInt(s, 0, 64) - *i = int32Value(v) - return err -} - -func (i *int32Value) Get() interface{} { - return int32(*i) -} - -func (i *int32Value) String() string { - return fmt.Sprintf("%v", *i) -} - -// NewInt32 behaves as flag.IntVar, but using an int32 type. -func NewInt32(v *int32) flag.Value { - return (*int32Value)(v) -} 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 b8d54752566..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/network.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright (c) 2014-2016 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 - isset bool -} - -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.name = 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 - flag.isset = true - return nil -} - -func (flag *NetworkFlag) IsSet() bool { - return flag.isset -} - -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 6adef518133..00000000000 --- 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 6e0c8ed0cd0..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/output.go +++ /dev/null @@ -1,217 +0,0 @@ -/* -Copyright (c) 2014-2016 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" - - "github.com/davecgh/go-spew/spew" -) - -type OutputWriter interface { - Write(io.Writer) error -} - -type OutputFlag struct { - common - - JSON bool - TTY bool - Dump 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") - f.BoolVar(&flag.Dump, "dump", false, "Enable output dump") - }) -} - -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 if flag.Dump { - scs := spew.ConfigState{Indent: " "} - scs.Fdump(out, 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 cdbc9905403..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/resource_pool.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (c) 2014-2016 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 21e167c732f..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/search.go +++ /dev/null @@ -1,392 +0,0 @@ -/* -Copyright (c) 2014-2016 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/storage_pod.go b/vendor/github.com/vmware/govmomi/govc/flags/storage_pod.go deleted file mode 100644 index 4cf0463cbe0..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/flags/storage_pod.go +++ /dev/null @@ -1,78 +0,0 @@ -package flags - -import ( - "flag" - "fmt" - "os" - - "golang.org/x/net/context" - - "github.com/vmware/govmomi/object" -) - -type StoragePodFlag struct { - common - - *DatacenterFlag - - Name string - - sp *object.StoragePod -} - -var storagePodFlagKey = flagKey("storagePod") - -func NewStoragePodFlag(ctx context.Context) (*StoragePodFlag, context.Context) { - if v := ctx.Value(storagePodFlagKey); v != nil { - return v.(*StoragePodFlag), ctx - } - - v := &StoragePodFlag{} - v.DatacenterFlag, ctx = NewDatacenterFlag(ctx) - ctx = context.WithValue(ctx, storagePodFlagKey, v) - return v, ctx -} - -func (f *StoragePodFlag) Register(ctx context.Context, fs *flag.FlagSet) { - f.RegisterOnce(func() { - f.DatacenterFlag.Register(ctx, fs) - - env := "GOVC_DATASTORE_CLUSTER" - value := os.Getenv(env) - usage := fmt.Sprintf("Datastore cluster [%s]", env) - fs.StringVar(&f.Name, "datastore-cluster", value, usage) - }) -} - -func (f *StoragePodFlag) Process(ctx context.Context) error { - return f.DatacenterFlag.Process(ctx) -} - -func (f *StoragePodFlag) Isset() bool { - return f.Name != "" -} - -func (f *StoragePodFlag) StoragePod() (*object.StoragePod, error) { - if f.sp != nil { - return f.sp, nil - } - - finder, err := f.Finder() - if err != nil { - return nil, err - } - - if f.Isset() { - f.sp, err = finder.DatastoreCluster(context.TODO(), f.Name) - if err != nil { - return nil, err - } - } else { - f.sp, err = finder.DefaultDatastoreCluster(context.TODO()) - if err != nil { - return nil, err - } - } - - return f.sp, 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 d0b5f0ac7d2..00000000000 --- 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 e85819fa010..00000000000 --- 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 0d3cc9a118c..00000000000 --- 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 aaed989cd4f..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/add.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -Copyright (c) 2015-2016 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 ec1fe3459ae..00000000000 --- 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 4e260db32d1..00000000000 --- 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 7b42bdfb2d0..00000000000 --- 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.Var(flags.NewInt32(&cmd.StartDelay), "start-delay", "") - f.StringVar(&cmd.StopAction, "stop-action", "", "") - f.Var(flags.NewInt32(&cmd.StopDelay), "stop-delay", "") - 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 33bd9ec89be..00000000000 --- 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 b41d5ec11bb..00000000000 --- 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 6c8ed9b8008..00000000000 --- 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 c36e89a4099..00000000000 --- 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 010d3b88501..00000000000 --- 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 05579105627..00000000000 --- 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 ee4477a2f4d..00000000000 --- 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 087144974c8..00000000000 --- 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 b9e3474a799..00000000000 --- 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 9c1e9462f8b..00000000000 --- 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 56697933831..00000000000 --- 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 2957748c6c8..00000000000 --- 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 c55a6044897..00000000000 --- 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.Var(flags.NewInt32(&cmd.Port), "port", "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 99428ae3758..00000000000 --- 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 := int32(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 2a473205cae..00000000000 --- 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 int32 - 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.Var(flags.NewInt32(&cmd.timeout), "timeout", "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 88c63c230c6..00000000000 --- 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 int32 -} - -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.Var(flags.NewInt32(&cmd.timeout), "timeout", "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 f3767fc9dc2..00000000000 --- 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.Var(flags.NewInt32(&cmd.spec.VlanId), "vlan", "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 174455ae556..00000000000 --- 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 26f0c3225b4..00000000000 --- 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 c9235e0fb4a..00000000000 --- 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 9d132399d7f..00000000000 --- 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 5e3d4d5d726..00000000000 --- 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 7631b64eee6..00000000000 --- 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 3198974c343..00000000000 --- 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 14e3f8ea4df..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/host/vswitch/add.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 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) - - cmd.spec.NumPorts = 128 // default - f.Var(flags.NewInt32(&cmd.spec.NumPorts), "ports", "Number of ports") - f.Var(flags.NewInt32(&cmd.spec.Mtu), "mtu", "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 589be130212..00000000000 --- 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 c5660d32250..00000000000 --- 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 92722549c54..00000000000 --- 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 924e75f2ca4..00000000000 --- 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 14e31670b0a..00000000000 --- 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 441382c2e6b..00000000000 --- 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 := int32(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 76c61786a8c..00000000000 --- 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 ce33484f6c3..00000000000 --- 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 882306b1116..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/ovf.go +++ /dev/null @@ -1,405 +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)) - } - } - - 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 410707e811b..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/spec.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright (c) 2015-2016 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 972451d55e7..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/importx/vmdk.go +++ /dev/null @@ -1,495 +0,0 @@ -/* -Copyright (c) 2014-2016 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) { - var devices object.VirtualDeviceList - - controller, err := devices.CreateSCSIController("") - if err != nil { - panic(err) - } - devices = append(devices, controller) - - disk := devices.CreateDisk(controller.(types.BaseVirtualController), ds.Reference(), ds.Path(path)) - devices = append(devices, disk) - - spec, err := devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) - if err != nil { - panic(err) - } - - c.DeviceChange = append(c.DeviceChange, spec...) -} - -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 a161c3d87e5..00000000000 --- 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 aedf239bc7a..00000000000 --- 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 682e831a79b..00000000000 --- 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 aadbed31931..00000000000 --- 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 382d75441e1..00000000000 --- 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 e4cfe42a5f9..00000000000 --- 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 886a2bbb948..00000000000 --- 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 04ef29c56a3..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/logs/command.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -Copyright (c) 2015-2016 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 int32 - 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) - - cmd.Max = 25 // default - f.Var(flags.NewInt32(&cmd.Max), "n", "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 5fa709c0c25..00000000000 --- 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 f2ca10775f5..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/logs/ls.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright (c) 2015-2016 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 91b95ca3e00..00000000000 --- 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 3212d8634ed..00000000000 --- 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 665809366a2..00000000000 --- 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 becec48931c..00000000000 --- 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 6b58e7e476f..00000000000 --- 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 126733aea47..00000000000 --- 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 affad742054..00000000000 --- 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 48c99c7017b..00000000000 --- 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 - - children 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.children, "children", false, "Remove all children pools") -} - -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.children { - err = pool.DestroyChildren(context.TODO()) - if err != nil { - return err - } - } else { - 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 dbd8ca23bd7..00000000000 --- 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 bad77272964..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/pool/info.go +++ /dev/null @@ -1,212 +0,0 @@ -/* -Copyright (c) 2015-2016 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 dfeeddff5d2..00000000000 --- 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 = int32(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 f934ad34297..00000000000 --- 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 8000dd9db47..00000000000 --- 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 137f78bfdfa..00000000000 --- 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 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 e52d16be97f..00000000000 --- 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 c7700852c35..00000000000 --- 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 326c99bb4b0..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/cli.bats +++ /dev/null @@ -1,30 +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} -} - -@test "connect to an endpoint with user provided Vim namespace and Vim version" { - run govc about -vim-namespace urn:vim25 -vim-version 6.0 - assert_success -} 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 9a1a94a01b9..00000000000 --- 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 c1d4acac6c2..00000000000 --- 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 ea1305cce89..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/device.bats +++ /dev/null @@ -1,208 +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 - - run govc device.info -vm $vm -net enoent - assert_failure - - run govc device.info -vm $vm -net "VM Network" ide-200 - assert_failure - - result=$(govc device.info -vm $vm -net "VM Network" | grep "MAC Address" | wc -l) - [ $result -eq 1 ] -} - -@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 df9a01576ff..00000000000 --- 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" { - skip_if_vca - 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 e81a61c1ce0..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/license.bats +++ /dev/null @@ -1,55 +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" { - skip_if_vca - 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" { - skip_if_vca - 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 733cd8f9c2f..00000000000 --- 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 9464eb4154c..00000000000 --- 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 242e013c893..00000000000 --- 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 76915f9f4ae..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/pool.bats +++ /dev/null @@ -1,293 +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) - - # parent pool - path="*/Resources/$id" - run govc pool.create $path - assert_success - - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 0 ] - - # child pools - id1=$(new_id) - run govc pool.create $path/$id1 - assert_success - - id2=$(new_id) - run govc pool.create $path/$id2 - assert_success - - # 2 child pools - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 2 ] - - # 1 parent pool - result=$(govc ls "host/$path" | wc -l) - [ $result -eq 1 ] - - run govc pool.destroy $path - assert_success - - # no more parent pool - result=$(govc ls "host/$path" | wc -l) - [ $result -eq 0 ] - - # the child pools are not present anymore - # the only place they could pop into is the parent pool - - # first child pool - result=$(govc ls "host/*/Resources/$id1" | wc -l) - [ $result -eq 0 ] - - # second child pool - result=$(govc ls "host/*/Resources/$id2" | wc -l) - [ $result -eq 0 ] -} - -@test "pool.destroy children" { - id=$(new_id) - - # 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 ] - - # delete childs - run govc pool.destroy -children $path - assert_success - - # no more child pools - result=$(govc ls "host/$path/*" | wc -l) - [ $result -eq 0 ] - - # cleanup - run govc pool.destroy $path - assert_success - - # cleanup check - result=$(govc ls "host/$path" | 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 -mem.limit 100 -mem.expandable=false $child_path - assert_failure - - run govc pool.change -mem.limit 100 $child_path - assert_success - - run govc pool.change -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 50145266713..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/test_helper.bash +++ /dev/null @@ -1,260 +0,0 @@ -# set the following variables only if they've not been set -GOVC_TEST_URL=${GOVC_TEST_URL-"https://root:vagrant@localhost:18443/sdk"} -export GOVC_URL=$GOVC_TEST_URL -export GOVC_DATASTORE=${GOVC_DATASTORE-datastore1} -export GOVC_NETWORK=${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 - govc ls "host/*/Resources/govc-test-*" | $xargs -r govc pool.destroy -} - -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 -} - -skip_if_vca() { - if [ -n "$VCA" ]; then - skip "disabled in vCA" - 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}') - if ! grep -q "//" <<<"$GOVC_URL"; then - userpass=$(awk -F@ '{print $1}' <<<"$GOVC_URL") - fi - 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 76a3b6d3fb4..00000000000 --- 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 9732c277ca5..00000000000 --- 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 e824b246ddb..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/test/vm.bats +++ /dev/null @@ -1,402 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -@test "vm.ip" { - skip - id=$(new_ttylinux_vm) - - run govc vm.power -on $id - assert_success - - run govc vm.ip $id - assert_success -} - -@test "vm.ip -esxcli" { - skip - 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" { - import_ttylinux_vmdk - - 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" { - import_ttylinux_vmdk - - 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" { - import_ttylinux_vmdk - - 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 scsi disk with datastore argument" { - import_ttylinux_vmdk - - vm=$(new_id) - - run govc vm.create -disk="${GOVC_TEST_VMDK}" -disk-datastore="${GOVC_DATASTORE}" -on=false -link=false $vm - assert_success - - run govc device.info -vm $vm disk-1000-0 - assert_success - 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.create iso with datastore argument" { - upload_iso - - vm=$(new_id) - - run govc vm.create -iso="${GOVC_TEST_ISO}" -iso-datastore="${GOVC_DATASTORE}" -on=false $vm - assert_success - - run govc device.info -vm $vm cdrom-3000 - assert_success - 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 ] -} - -@test "vm.create new disk with datastore argument" { - vm=$(new_id) - - run govc vm.create -disk="1GiB" -ds="${GOVC_DATASTORE}" -on=false -link=false $vm - assert_success - - run govc device.info -vm $vm disk-1000-0 - assert_success - assert_line "File: [${GOVC_DATASTORE##*/}] ${vm}/${vm}.vmdk" -} - -@test "vm.create new disk with datastore cluster argument" { - if [ -z "${GOVC_DATASTORE_CLUSTER}" ]; then - skip "requires datastore cluster" - fi - - vm=$(new_id) - - run govc vm.create -disk="1GiB" -datastore-cluster="${GOVC_DATASTORE_CLUSTER}" -on=false -link=false $vm - assert_success - - run govc device.info -vm $vm disk-1000-0 - assert_success -} 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 8f66428e40f..00000000000 --- 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 a03dc958fc0..00000000000 --- 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 68ef342f650..00000000000 --- 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 d39d0712e7e..00000000000 --- 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.SplitN(v, "=", 2) - 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.Var(flags.NewInt32(&cmd.NumCPUs), "c", "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 e1e82e80c3e..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/create.go +++ /dev/null @@ -1,493 +0,0 @@ -/* -Copyright (c) 2014-2016 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/property" - "github.com/vmware/govmomi/units" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type create struct { - *flags.ClientFlag - *flags.DatacenterFlag - *flags.DatastoreFlag - *flags.StoragePodFlag - *flags.ResourcePoolFlag - *flags.HostSystemFlag - *flags.NetworkFlag - *flags.FolderFlag - - name string - memory int - cpus int - guestID string - link bool - on bool - force bool - controller string - - iso string - isoDatastoreFlag *flags.DatastoreFlag - isoDatastore *object.Datastore - - disk string - diskDatastoreFlag *flags.DatastoreFlag - diskDatastore *object.Datastore - - // Only set if the disk argument is a byte size, which means the disk - // doesn't exist yet and should be created - diskByteSize int64 - - Client *vim25.Client - Datacenter *object.Datacenter - Datastore *object.Datastore - StoragePod *object.StoragePod - ResourcePool *object.ResourcePool - HostSystem *object.HostSystem - Folder *object.Folder -} - -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.StoragePodFlag, ctx = flags.NewStoragePodFlag(ctx) - cmd.StoragePodFlag.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) - - cmd.FolderFlag, ctx = flags.NewFolderFlag(ctx) - cmd.FolderFlag.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.controller, "disk.controller", "scsi", "Disk controller type") - - f.StringVar(&cmd.iso, "iso", "", "ISO path") - cmd.isoDatastoreFlag, ctx = flags.NewCustomDatastoreFlag(ctx) - f.StringVar(&cmd.isoDatastoreFlag.Name, "iso-datastore", "", "Datastore for ISO file") - - f.StringVar(&cmd.disk, "disk", "", "Disk path (to use existing) OR size (to create new, e.g. 20GB)") - cmd.diskDatastoreFlag, ctx = flags.NewCustomDatastoreFlag(ctx) - f.StringVar(&cmd.diskDatastoreFlag.Name, "disk-datastore", "", "Datastore for disk file") -} - -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.StoragePodFlag.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 - } - if err := cmd.FolderFlag.Process(ctx); err != nil { - return err - } - - // Default iso/disk datastores to the VM's datastore - if cmd.isoDatastoreFlag.Name == "" { - cmd.isoDatastoreFlag = cmd.DatastoreFlag - } - if cmd.diskDatastoreFlag.Name == "" { - cmd.diskDatastoreFlag = cmd.DatastoreFlag - } - - 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.name = f.Arg(0) - if cmd.name == "" { - 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 - } - - if cmd.StoragePodFlag.Isset() { - cmd.StoragePod, err = cmd.StoragePodFlag.StoragePod() - if err != nil { - return err - } - } else { - 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 - } - } - - if cmd.Folder, err = cmd.FolderFlag.Folder(); err != nil { - return err - } - - // Verify ISO exists - if cmd.iso != "" { - _, err = cmd.isoDatastoreFlag.Stat(context.TODO(), cmd.iso) - if err != nil { - return err - } - - cmd.isoDatastore, err = cmd.isoDatastoreFlag.Datastore() - if err != nil { - return err - } - } - - // Verify disk exists - if cmd.disk != "" { - var b units.ByteSize - - // If disk can be parsed as byte units, don't stat - err = b.Set(cmd.disk) - if err == nil { - cmd.diskByteSize = int64(b) - } else { - _, err = cmd.diskDatastoreFlag.Stat(context.TODO(), cmd.disk) - if err != nil { - return err - } - - cmd.diskDatastore, err = cmd.diskDatastoreFlag.Datastore() - if err != nil { - return err - } - } - } - - task, err := cmd.createVM(context.TODO()) - 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 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) createVM(ctx context.Context) (*object.Task, error) { - var devices object.VirtualDeviceList - var err error - - spec := &types.VirtualMachineConfigSpec{ - Name: cmd.name, - GuestId: cmd.guestID, - NumCPUs: int32(cmd.cpus), - MemoryMB: int64(cmd.memory), - } - - devices, err = cmd.addStorage(nil) - if err != nil { - return nil, err - } - - devices, err = cmd.addNetwork(devices) - if err != nil { - return nil, err - } - - deviceChange, err := devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) - if err != nil { - return nil, err - } - - spec.DeviceChange = deviceChange - - var datastore *object.Datastore - - // If storage pod is specified, collect placement recommendations - if cmd.StoragePod != nil { - datastore, err = cmd.recommendDatastore(ctx, spec) - if err != nil { - return nil, err - } - } else { - datastore = cmd.Datastore - } - - if !cmd.force { - vmxPath := fmt.Sprintf("%s/%s.vmx", cmd.name, cmd.name) - - _, err := datastore.Stat(ctx, vmxPath) - if err == nil { - dsPath := cmd.Datastore.Path(vmxPath) - return nil, fmt.Errorf("File %s already exists", dsPath) - } - } - - folder := cmd.Folder - - spec.Files = &types.VirtualMachineFileInfo{ - VmPathName: fmt.Sprintf("[%s]", datastore.Name()), - } - - return folder.CreateVM(ctx, *spec, cmd.ResourcePool, cmd.HostSystem) -} - -func (cmd *create) addStorage(devices object.VirtualDeviceList) (object.VirtualDeviceList, error) { - if cmd.controller != "ide" { - scsi, err := devices.CreateSCSIController(cmd.controller) - if err != nil { - return nil, err - } - - devices = append(devices, scsi) - } - - // If controller is specified to be IDE or if an ISO is specified, add IDE controller. - if cmd.controller == "ide" || cmd.iso != "" { - ide, err := devices.CreateIDEController() - if err != nil { - return nil, err - } - - devices = append(devices, ide) - } - - if cmd.diskByteSize != 0 { - controller, err := devices.FindDiskController(cmd.controller) - if err != nil { - return nil, err - } - - disk := &types.VirtualDisk{ - VirtualDevice: types.VirtualDevice{ - Key: devices.NewKey(), - Backing: &types.VirtualDiskFlatVer2BackingInfo{ - DiskMode: string(types.VirtualDiskModePersistent), - ThinProvisioned: types.NewBool(true), - }, - }, - CapacityInKB: cmd.diskByteSize / 1024, - } - - devices.AssignController(disk, controller) - devices = append(devices, disk) - } else if cmd.disk != "" { - controller, err := devices.FindDiskController(cmd.controller) - if err != nil { - return nil, err - } - - ds := cmd.diskDatastore.Reference() - path := cmd.diskDatastore.Path(cmd.disk) - disk := devices.CreateDisk(controller, ds, path) - - if cmd.link { - disk = devices.ChildDisk(disk) - } - - devices = append(devices, disk) - } - - if cmd.iso != "" { - ide, err := devices.FindIDEController("") - if err != nil { - return nil, err - } - - cdrom, err := devices.CreateCdrom(ide) - if err != nil { - return nil, err - } - - cdrom = devices.InsertIso(cdrom, cmd.isoDatastore.Path(cmd.iso)) - devices = append(devices, cdrom) - } - - return devices, nil -} - -func (cmd *create) addNetwork(devices object.VirtualDeviceList) (object.VirtualDeviceList, error) { - netdev, err := cmd.NetworkFlag.Device() - if err != nil { - return nil, err - } - - devices = append(devices, netdev) - return devices, nil -} - -func (cmd *create) recommendDatastore(ctx context.Context, spec *types.VirtualMachineConfigSpec) (*object.Datastore, error) { - sp := cmd.StoragePod.Reference() - - // Build pod selection spec from config spec - podSelectionSpec := types.StorageDrsPodSelectionSpec{ - StoragePod: &sp, - } - - // Keep list of disks that need to be placed - var disks []*types.VirtualDisk - - // Collect disks eligible for placement - for _, deviceConfigSpec := range spec.DeviceChange { - s := deviceConfigSpec.GetVirtualDeviceConfigSpec() - if s.Operation != types.VirtualDeviceConfigSpecOperationAdd { - continue - } - - if s.FileOperation != types.VirtualDeviceConfigSpecFileOperationCreate { - continue - } - - d, ok := s.Device.(*types.VirtualDisk) - if !ok { - continue - } - - podConfigForPlacement := types.VmPodConfigForPlacement{ - StoragePod: sp, - Disk: []types.PodDiskLocator{ - { - DiskId: d.Key, - DiskBackingInfo: d.Backing, - }, - }, - } - - podSelectionSpec.InitialVmConfig = append(podSelectionSpec.InitialVmConfig, podConfigForPlacement) - disks = append(disks, d) - } - - sps := types.StoragePlacementSpec{ - Type: string(types.StoragePlacementSpecPlacementTypeCreate), - ResourcePool: types.NewReference(cmd.ResourcePool.Reference()), - PodSelectionSpec: podSelectionSpec, - ConfigSpec: spec, - } - - srm := object.NewStorageResourceManager(cmd.Client) - result, err := srm.RecommendDatastores(ctx, sps) - if err != nil { - return nil, err - } - - // Use result to pin disks to recommended datastores - recs := result.Recommendations - if len(recs) == 0 { - return nil, fmt.Errorf("no recommendations") - } - - ds := recs[0].Action[0].(*types.StoragePlacementAction).Destination - - var mds mo.Datastore - err = property.DefaultCollector(cmd.Client).RetrieveOne(ctx, ds, []string{"name"}, &mds) - if err != nil { - return nil, err - } - - datastore := object.NewDatastore(cmd.Client, ds) - datastore.InventoryPath = mds.Name - - // Apply recommendation to eligible disks - for _, disk := range disks { - backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) - backing.Datastore = &ds - } - - return datastore, nil -} 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 9796a87ed37..00000000000 --- 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 037eb06d914..00000000000 --- 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.Reference(), 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 a35045d50f4..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/disk/create.go +++ /dev/null @@ -1,152 +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" - "fmt" - "strings" - - "github.com/vmware/govmomi/govc/cli" - "github.com/vmware/govmomi/govc/flags" - "github.com/vmware/govmomi/units" - "github.com/vmware/govmomi/vim25/types" - "golang.org/x/net/context" -) - -type create struct { - *flags.DatastoreFlag - *flags.OutputFlag - *flags.VirtualMachineFlag - - controller string - Name string - Bytes units.ByteSize - Thick bool - Eager bool - DiskMode string -} - -var vdmTypes = []string{ - string(types.VirtualDiskModePersistent), - string(types.VirtualDiskModeNonpersistent), - string(types.VirtualDiskModeUndoable), - string(types.VirtualDiskModeIndependent_persistent), - string(types.VirtualDiskModeIndependent_nonpersistent), - string(types.VirtualDiskModeAppend), -} - -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") - f.BoolVar(&cmd.Thick, "thick", false, "Thick provision new disk") - f.BoolVar(&cmd.Eager, "eager", false, "Eagerly scrub new disk") - f.StringVar(&cmd.DiskMode, "mode", "persistent", fmt.Sprintf("Disk mode (%s)", strings.Join(vdmTypes, "|"))) -} - -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 - } - - vdmMatch := false - for _, vdm := range vdmTypes { - if cmd.DiskMode == vdm { - vdmMatch = true - } - } - - if vdmMatch == false { - return errors.New("please specify a valid disk mode") - } - - disk := devices.CreateDisk(controller, ds.Reference(), ds.Path(cmd.Name)) - - existing := devices.SelectByBackingInfo(disk.Backing) - - if len(existing) > 0 { - cmd.Log("Disk already present\n") - return nil - } - - backing := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo) - - if cmd.Thick { - backing.ThinProvisioned = types.NewBool(false) - backing.EagerlyScrub = types.NewBool(cmd.Eager) - } - - backing.DiskMode = cmd.DiskMode - - 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 9648bf3c6e9..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/auth.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright (c) 2014-2016 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 4243af51fde..00000000000 --- 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 336c9fd131b..00000000000 --- 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 dc324c9e17d..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/guest/file_attr.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright (c) 2014-2016 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/govc/flags" - "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.Var(flags.NewInt32(&flag.OwnerId), "uid", "User ID") - f.Var(flags.NewInt32(&flag.GroupId), "gid", "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 193b03f6eed..00000000000 --- 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 f9f6a0172ae..00000000000 --- 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 bb7f6672398..00000000000 --- 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 9c2cc8106b6..00000000000 --- 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 - } - - var offset int32 - 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 += int32(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 28859b04014..00000000000 --- 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 ed0af945d97..00000000000 --- 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 c443b3bf1dd..00000000000 --- 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 4c7c85f74df..00000000000 --- 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 723fe893245..00000000000 --- 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 49818d09855..00000000000 --- 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 fb19a9a5cc2..00000000000 --- 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 494bb8a2622..00000000000 --- 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 6c0992cc2f2..00000000000 --- 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 8f6006ebc6f..00000000000 --- 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 f7b4035064c..00000000000 --- 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 a618ba939eb..00000000000 --- a/vendor/github.com/vmware/govmomi/govc/vm/power.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright (c) 2014-2016 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 1ea6dc5a68c..00000000000 --- 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 55fe7197582..00000000000 --- 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 c62f012ce51..00000000000 --- 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 3d2d9b62ee6..00000000000 --- 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 int32, maxResults int32, 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 3c5394d9da2..00000000000 --- 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 159a571d710..00000000000 --- 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 509c94f991d..00000000000 --- 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 1e268f29dd0..00000000000 --- 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 ce20bde19f0..00000000000 --- 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 6284b1ac581..00000000000 --- 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 5a5fc2f622e..00000000000 --- 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 af96b15481c..00000000000 --- 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 eea02d6770e..00000000000 --- 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 d0153ee2925..00000000000 --- 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 60987384263..00000000000 --- 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 0cb51abf883..00000000000 --- 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 7dfe744e99e..00000000000 --- 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 1c3bd22d41b..00000000000 --- 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 d47cad02c98..00000000000 --- 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 cd5d9c70b3a..00000000000 --- 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 705799b7412..00000000000 --- 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 487253b21eb..00000000000 --- 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 976cc17de37..00000000000 --- 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 d1b2427d545..00000000000 --- 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 ea762ebd987..00000000000 --- 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 4bcff639af2..00000000000 --- 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 1852200cf0b..00000000000 --- 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 f69db75009c..00000000000 --- 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 48208364a7f..00000000000 --- 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/view/list_view.go b/vendor/github.com/vmware/govmomi/view/list_view.go deleted file mode 100644 index 145d4dc5e79..00000000000 --- a/vendor/github.com/vmware/govmomi/view/list_view.go +++ /dev/null @@ -1,33 +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 view - -import ( - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/types" -) - -type ListView struct { - *object.ListView -} - -func NewListView(c *vim25.Client, ref types.ManagedObjectReference) *ListView { - return &ListView{ - ListView: object.NewListView(c, ref), - } -} diff --git a/vendor/github.com/vmware/govmomi/view/manager.go b/vendor/github.com/vmware/govmomi/view/manager.go deleted file mode 100644 index 7c179b1ece2..00000000000 --- a/vendor/github.com/vmware/govmomi/view/manager.go +++ /dev/null @@ -1,51 +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 view - -import ( - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "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.ViewManager), - } - - return &m -} - -func (m Manager) CreateListView(ctx context.Context, objects []types.ManagedObjectReference) (*ListView, error) { - req := types.CreateListView{ - This: m.Common.Reference(), - Obj: objects, - } - - res, err := methods.CreateListView(ctx, m.Client(), &req) - if err != nil { - return nil, err - } - - return NewListView(m.Client(), res.Returnval), 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 be218c05210..00000000000 --- 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 05d369d85d8..00000000000 --- 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 ed44167f450..00000000000 --- 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 2a7fcdbdfaa..00000000000 --- 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 54baaf5ffa2..00000000000 --- 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/xyproto/simpleredis/example/main.go b/vendor/github.com/xyproto/simpleredis/example/main.go deleted file mode 100644 index 95626326dce..00000000000 --- a/vendor/github.com/xyproto/simpleredis/example/main.go +++ /dev/null @@ -1,49 +0,0 @@ -package main - -import ( - "log" - - "github.com/xyproto/simpleredis" -) - -func main() { - // Check if the redis service is up - if err := simpleredis.TestConnection(); err != nil { - log.Fatalln("Could not connect to Redis. Is the service up and running?") - } - - // Use instead for testing if a different host/port is up. - // simpleredis.TestConnectionHost("localhost:6379") - - // Create a connection pool, connect to the given redis server - pool := simpleredis.NewConnectionPool() - - // Use this for connecting to a different redis host/port - // pool := simpleredis.NewConnectionPoolHost("localhost:6379") - - // For connecting to a different redis host/port, with a password - // pool := simpleredis.NewConnectionPoolHost("password@redishost:6379") - - // Close the connection pool right after this function returns - defer pool.Close() - - // Create a list named "greetings" - list := simpleredis.NewList(pool, "greetings") - - // Add "hello" to the list, check if there are errors - if list.Add("hello") != nil { - log.Fatalln("Could not add an item to list!") - } - - // Get the last item of the list - if item, err := list.GetLast(); err != nil { - log.Fatalln("Could not fetch the last item from the list!") - } else { - log.Println("The value of the stored item is:", item) - } - - // Remove the list - if list.Remove() != nil { - log.Fatalln("Could not remove the list!") - } -} diff --git a/vendor/go4.org/legal/legal.go b/vendor/go4.org/legal/legal.go deleted file mode 100644 index de9ae9c8589..00000000000 --- a/vendor/go4.org/legal/legal.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2014 The Go4 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. -*/ - -// Package legal provides in-process storage for compiled-in licenses. -package legal - -var licenses []string - -// RegisterLicense stores the license text. -// It doesn't check whether the text was already present. -func RegisterLicense(text string) { - licenses = append(licenses, text) - return -} - -// Licenses returns a slice of the licenses. -func Licenses() []string { - return licenses -} diff --git a/vendor/golang.org/x/crypto/ssh/agent/client.go b/vendor/golang.org/x/crypto/ssh/agent/client.go deleted file mode 100644 index c98cb16b2b8..00000000000 --- a/vendor/golang.org/x/crypto/ssh/agent/client.go +++ /dev/null @@ -1,563 +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 agent implements a client to an ssh-agent daemon. - -References: - [PROTOCOL.agent]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.agent?rev=HEAD -*/ -package agent - -import ( - "bytes" - "crypto/dsa" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rsa" - "encoding/base64" - "encoding/binary" - "errors" - "fmt" - "io" - "math/big" - "sync" - - "golang.org/x/crypto/ssh" -) - -// Agent represents the capabilities of an ssh-agent. -type Agent interface { - // List returns the identities known to the agent. - List() ([]*Key, error) - - // Sign has the agent sign the data using a protocol 2 key as defined - // in [PROTOCOL.agent] section 2.6.2. - Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) - - // Insert adds a private key to the agent. If a certificate - // is given, that certificate is added as public key. - Add(s interface{}, cert *ssh.Certificate, comment string) error - - // Remove removes all identities with the given public key. - Remove(key ssh.PublicKey) error - - // RemoveAll removes all identities. - RemoveAll() error - - // Lock locks the agent. Sign and Remove will fail, and List will empty an empty list. - Lock(passphrase []byte) error - - // Unlock undoes the effect of Lock - Unlock(passphrase []byte) error - - // Signers returns signers for all the known keys. - Signers() ([]ssh.Signer, error) -} - -// See [PROTOCOL.agent], section 3. -const ( - agentRequestV1Identities = 1 - - // 3.2 Requests from client to agent for protocol 2 key operations - agentAddIdentity = 17 - agentRemoveIdentity = 18 - agentRemoveAllIdentities = 19 - agentAddIdConstrained = 25 - - // 3.3 Key-type independent requests from client to agent - agentAddSmartcardKey = 20 - agentRemoveSmartcardKey = 21 - agentLock = 22 - agentUnlock = 23 - agentAddSmartcardKeyConstrained = 26 - - // 3.7 Key constraint identifiers - agentConstrainLifetime = 1 - agentConstrainConfirm = 2 -) - -// maxAgentResponseBytes is the maximum agent reply size that is accepted. This -// is a sanity check, not a limit in the spec. -const maxAgentResponseBytes = 16 << 20 - -// Agent messages: -// These structures mirror the wire format of the corresponding ssh agent -// messages found in [PROTOCOL.agent]. - -// 3.4 Generic replies from agent to client -const agentFailure = 5 - -type failureAgentMsg struct{} - -const agentSuccess = 6 - -type successAgentMsg struct{} - -// See [PROTOCOL.agent], section 2.5.2. -const agentRequestIdentities = 11 - -type requestIdentitiesAgentMsg struct{} - -// See [PROTOCOL.agent], section 2.5.2. -const agentIdentitiesAnswer = 12 - -type identitiesAnswerAgentMsg struct { - NumKeys uint32 `sshtype:"12"` - Keys []byte `ssh:"rest"` -} - -// See [PROTOCOL.agent], section 2.6.2. -const agentSignRequest = 13 - -type signRequestAgentMsg struct { - KeyBlob []byte `sshtype:"13"` - Data []byte - Flags uint32 -} - -// See [PROTOCOL.agent], section 2.6.2. - -// 3.6 Replies from agent to client for protocol 2 key operations -const agentSignResponse = 14 - -type signResponseAgentMsg struct { - SigBlob []byte `sshtype:"14"` -} - -type publicKey struct { - Format string - Rest []byte `ssh:"rest"` -} - -// Key represents a protocol 2 public key as defined in -// [PROTOCOL.agent], section 2.5.2. -type Key struct { - Format string - Blob []byte - Comment string -} - -func clientErr(err error) error { - return fmt.Errorf("agent: client error: %v", err) -} - -// String returns the storage form of an agent key with the format, base64 -// encoded serialized key, and the comment if it is not empty. -func (k *Key) String() string { - s := string(k.Format) + " " + base64.StdEncoding.EncodeToString(k.Blob) - - if k.Comment != "" { - s += " " + k.Comment - } - - return s -} - -// Type returns the public key type. -func (k *Key) Type() string { - return k.Format -} - -// Marshal returns key blob to satisfy the ssh.PublicKey interface. -func (k *Key) Marshal() []byte { - return k.Blob -} - -// Verify satisfies the ssh.PublicKey interface, but is not -// implemented for agent keys. -func (k *Key) Verify(data []byte, sig *ssh.Signature) error { - return errors.New("agent: agent key does not know how to verify") -} - -type wireKey struct { - Format string - Rest []byte `ssh:"rest"` -} - -func parseKey(in []byte) (out *Key, rest []byte, err error) { - var record struct { - Blob []byte - Comment string - Rest []byte `ssh:"rest"` - } - - if err := ssh.Unmarshal(in, &record); err != nil { - return nil, nil, err - } - - var wk wireKey - if err := ssh.Unmarshal(record.Blob, &wk); err != nil { - return nil, nil, err - } - - return &Key{ - Format: wk.Format, - Blob: record.Blob, - Comment: record.Comment, - }, record.Rest, nil -} - -// client is a client for an ssh-agent process. -type client struct { - // conn is typically a *net.UnixConn - conn io.ReadWriter - // mu is used to prevent concurrent access to the agent - mu sync.Mutex -} - -// NewClient returns an Agent that talks to an ssh-agent process over -// the given connection. -func NewClient(rw io.ReadWriter) Agent { - return &client{conn: rw} -} - -// call sends an RPC to the agent. On success, the reply is -// unmarshaled into reply and replyType is set to the first byte of -// the reply, which contains the type of the message. -func (c *client) call(req []byte) (reply interface{}, err error) { - c.mu.Lock() - defer c.mu.Unlock() - - msg := make([]byte, 4+len(req)) - binary.BigEndian.PutUint32(msg, uint32(len(req))) - copy(msg[4:], req) - if _, err = c.conn.Write(msg); err != nil { - return nil, clientErr(err) - } - - var respSizeBuf [4]byte - if _, err = io.ReadFull(c.conn, respSizeBuf[:]); err != nil { - return nil, clientErr(err) - } - respSize := binary.BigEndian.Uint32(respSizeBuf[:]) - if respSize > maxAgentResponseBytes { - return nil, clientErr(err) - } - - buf := make([]byte, respSize) - if _, err = io.ReadFull(c.conn, buf); err != nil { - return nil, clientErr(err) - } - reply, err = unmarshal(buf) - if err != nil { - return nil, clientErr(err) - } - return reply, err -} - -func (c *client) simpleCall(req []byte) error { - resp, err := c.call(req) - if err != nil { - return err - } - if _, ok := resp.(*successAgentMsg); ok { - return nil - } - return errors.New("agent: failure") -} - -func (c *client) RemoveAll() error { - return c.simpleCall([]byte{agentRemoveAllIdentities}) -} - -func (c *client) Remove(key ssh.PublicKey) error { - req := ssh.Marshal(&agentRemoveIdentityMsg{ - KeyBlob: key.Marshal(), - }) - return c.simpleCall(req) -} - -func (c *client) Lock(passphrase []byte) error { - req := ssh.Marshal(&agentLockMsg{ - Passphrase: passphrase, - }) - return c.simpleCall(req) -} - -func (c *client) Unlock(passphrase []byte) error { - req := ssh.Marshal(&agentUnlockMsg{ - Passphrase: passphrase, - }) - return c.simpleCall(req) -} - -// List returns the identities known to the agent. -func (c *client) List() ([]*Key, error) { - // see [PROTOCOL.agent] section 2.5.2. - req := []byte{agentRequestIdentities} - - msg, err := c.call(req) - if err != nil { - return nil, err - } - - switch msg := msg.(type) { - case *identitiesAnswerAgentMsg: - if msg.NumKeys > maxAgentResponseBytes/8 { - return nil, errors.New("agent: too many keys in agent reply") - } - keys := make([]*Key, msg.NumKeys) - data := msg.Keys - for i := uint32(0); i < msg.NumKeys; i++ { - var key *Key - var err error - if key, data, err = parseKey(data); err != nil { - return nil, err - } - keys[i] = key - } - return keys, nil - case *failureAgentMsg: - return nil, errors.New("agent: failed to list keys") - } - panic("unreachable") -} - -// Sign has the agent sign the data using a protocol 2 key as defined -// in [PROTOCOL.agent] section 2.6.2. -func (c *client) Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) { - req := ssh.Marshal(signRequestAgentMsg{ - KeyBlob: key.Marshal(), - Data: data, - }) - - msg, err := c.call(req) - if err != nil { - return nil, err - } - - switch msg := msg.(type) { - case *signResponseAgentMsg: - var sig ssh.Signature - if err := ssh.Unmarshal(msg.SigBlob, &sig); err != nil { - return nil, err - } - - return &sig, nil - case *failureAgentMsg: - return nil, errors.New("agent: failed to sign challenge") - } - panic("unreachable") -} - -// unmarshal parses an agent message in packet, returning the parsed -// form and the message type of packet. -func unmarshal(packet []byte) (interface{}, error) { - if len(packet) < 1 { - return nil, errors.New("agent: empty packet") - } - var msg interface{} - switch packet[0] { - case agentFailure: - return new(failureAgentMsg), nil - case agentSuccess: - return new(successAgentMsg), nil - case agentIdentitiesAnswer: - msg = new(identitiesAnswerAgentMsg) - case agentSignResponse: - msg = new(signResponseAgentMsg) - default: - return nil, fmt.Errorf("agent: unknown type tag %d", packet[0]) - } - if err := ssh.Unmarshal(packet, msg); err != nil { - return nil, err - } - return msg, nil -} - -type rsaKeyMsg struct { - Type string `sshtype:"17"` - N *big.Int - E *big.Int - D *big.Int - Iqmp *big.Int // IQMP = Inverse Q Mod P - P *big.Int - Q *big.Int - Comments string -} - -type dsaKeyMsg struct { - Type string `sshtype:"17"` - P *big.Int - Q *big.Int - G *big.Int - Y *big.Int - X *big.Int - Comments string -} - -type ecdsaKeyMsg struct { - Type string `sshtype:"17"` - Curve string - KeyBytes []byte - D *big.Int - Comments string -} - -// Insert adds a private key to the agent. -func (c *client) insertKey(s interface{}, comment string) error { - var req []byte - switch k := s.(type) { - case *rsa.PrivateKey: - if len(k.Primes) != 2 { - return fmt.Errorf("agent: unsupported RSA key with %d primes", len(k.Primes)) - } - k.Precompute() - req = ssh.Marshal(rsaKeyMsg{ - Type: ssh.KeyAlgoRSA, - N: k.N, - E: big.NewInt(int64(k.E)), - D: k.D, - Iqmp: k.Precomputed.Qinv, - P: k.Primes[0], - Q: k.Primes[1], - Comments: comment, - }) - case *dsa.PrivateKey: - req = ssh.Marshal(dsaKeyMsg{ - Type: ssh.KeyAlgoDSA, - P: k.P, - Q: k.Q, - G: k.G, - Y: k.Y, - X: k.X, - Comments: comment, - }) - case *ecdsa.PrivateKey: - nistID := fmt.Sprintf("nistp%d", k.Params().BitSize) - req = ssh.Marshal(ecdsaKeyMsg{ - Type: "ecdsa-sha2-" + nistID, - Curve: nistID, - KeyBytes: elliptic.Marshal(k.Curve, k.X, k.Y), - D: k.D, - Comments: comment, - }) - default: - return fmt.Errorf("agent: unsupported key type %T", s) - } - resp, err := c.call(req) - if err != nil { - return err - } - if _, ok := resp.(*successAgentMsg); ok { - return nil - } - return errors.New("agent: failure") -} - -type rsaCertMsg struct { - Type string `sshtype:"17"` - CertBytes []byte - D *big.Int - Iqmp *big.Int // IQMP = Inverse Q Mod P - P *big.Int - Q *big.Int - Comments string -} - -type dsaCertMsg struct { - Type string `sshtype:"17"` - CertBytes []byte - X *big.Int - Comments string -} - -type ecdsaCertMsg struct { - Type string `sshtype:"17"` - CertBytes []byte - D *big.Int - Comments string -} - -// Insert adds a private key to the agent. If a certificate is given, -// that certificate is added instead as public key. -func (c *client) Add(s interface{}, cert *ssh.Certificate, comment string) error { - if cert == nil { - return c.insertKey(s, comment) - } else { - return c.insertCert(s, cert, comment) - } -} - -func (c *client) insertCert(s interface{}, cert *ssh.Certificate, comment string) error { - var req []byte - switch k := s.(type) { - case *rsa.PrivateKey: - if len(k.Primes) != 2 { - return fmt.Errorf("agent: unsupported RSA key with %d primes", len(k.Primes)) - } - k.Precompute() - req = ssh.Marshal(rsaCertMsg{ - Type: cert.Type(), - CertBytes: cert.Marshal(), - D: k.D, - Iqmp: k.Precomputed.Qinv, - P: k.Primes[0], - Q: k.Primes[1], - Comments: comment, - }) - case *dsa.PrivateKey: - req = ssh.Marshal(dsaCertMsg{ - Type: cert.Type(), - CertBytes: cert.Marshal(), - X: k.X, - Comments: comment, - }) - case *ecdsa.PrivateKey: - req = ssh.Marshal(ecdsaCertMsg{ - Type: cert.Type(), - CertBytes: cert.Marshal(), - D: k.D, - Comments: comment, - }) - default: - return fmt.Errorf("agent: unsupported key type %T", s) - } - - signer, err := ssh.NewSignerFromKey(s) - if err != nil { - return err - } - if bytes.Compare(cert.Key.Marshal(), signer.PublicKey().Marshal()) != 0 { - return errors.New("agent: signer and cert have different public key") - } - - resp, err := c.call(req) - if err != nil { - return err - } - if _, ok := resp.(*successAgentMsg); ok { - return nil - } - return errors.New("agent: failure") -} - -// Signers provides a callback for client authentication. -func (c *client) Signers() ([]ssh.Signer, error) { - keys, err := c.List() - if err != nil { - return nil, err - } - - var result []ssh.Signer - for _, k := range keys { - result = append(result, &agentKeyringSigner{c, k}) - } - return result, nil -} - -type agentKeyringSigner struct { - agent *client - pub ssh.PublicKey -} - -func (s *agentKeyringSigner) PublicKey() ssh.PublicKey { - return s.pub -} - -func (s *agentKeyringSigner) Sign(rand io.Reader, data []byte) (*ssh.Signature, error) { - // The agent has its own entropy source, so the rand argument is ignored. - return s.agent.Sign(s.pub, data) -} diff --git a/vendor/golang.org/x/crypto/ssh/agent/forward.go b/vendor/golang.org/x/crypto/ssh/agent/forward.go deleted file mode 100644 index fd24ba900d2..00000000000 --- a/vendor/golang.org/x/crypto/ssh/agent/forward.go +++ /dev/null @@ -1,103 +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 agent - -import ( - "errors" - "io" - "net" - "sync" - - "golang.org/x/crypto/ssh" -) - -// RequestAgentForwarding sets up agent forwarding for the session. -// ForwardToAgent or ForwardToRemote should be called to route -// the authentication requests. -func RequestAgentForwarding(session *ssh.Session) error { - ok, err := session.SendRequest("auth-agent-req@openssh.com", true, nil) - if err != nil { - return err - } - if !ok { - return errors.New("forwarding request denied") - } - return nil -} - -// ForwardToAgent routes authentication requests to the given keyring. -func ForwardToAgent(client *ssh.Client, keyring Agent) error { - channels := client.HandleChannelOpen(channelType) - if channels == nil { - return errors.New("agent: already have handler for " + channelType) - } - - go func() { - for ch := range channels { - channel, reqs, err := ch.Accept() - if err != nil { - continue - } - go ssh.DiscardRequests(reqs) - go func() { - ServeAgent(keyring, channel) - channel.Close() - }() - } - }() - return nil -} - -const channelType = "auth-agent@openssh.com" - -// ForwardToRemote routes authentication requests to the ssh-agent -// process serving on the given unix socket. -func ForwardToRemote(client *ssh.Client, addr string) error { - channels := client.HandleChannelOpen(channelType) - if channels == nil { - return errors.New("agent: already have handler for " + channelType) - } - conn, err := net.Dial("unix", addr) - if err != nil { - return err - } - conn.Close() - - go func() { - for ch := range channels { - channel, reqs, err := ch.Accept() - if err != nil { - continue - } - go ssh.DiscardRequests(reqs) - go forwardUnixSocket(channel, addr) - } - }() - return nil -} - -func forwardUnixSocket(channel ssh.Channel, addr string) { - conn, err := net.Dial("unix", addr) - if err != nil { - return - } - - var wg sync.WaitGroup - wg.Add(2) - go func() { - io.Copy(conn, channel) - conn.(*net.UnixConn).CloseWrite() - wg.Done() - }() - go func() { - io.Copy(channel, conn) - channel.CloseWrite() - wg.Done() - }() - - wg.Wait() - conn.Close() - channel.Close() -} diff --git a/vendor/golang.org/x/crypto/ssh/agent/keyring.go b/vendor/golang.org/x/crypto/ssh/agent/keyring.go deleted file mode 100644 index 8ac20090ad9..00000000000 --- a/vendor/golang.org/x/crypto/ssh/agent/keyring.go +++ /dev/null @@ -1,183 +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 agent - -import ( - "bytes" - "crypto/rand" - "crypto/subtle" - "errors" - "fmt" - "sync" - - "golang.org/x/crypto/ssh" -) - -type privKey struct { - signer ssh.Signer - comment string -} - -type keyring struct { - mu sync.Mutex - keys []privKey - - locked bool - passphrase []byte -} - -var errLocked = errors.New("agent: locked") - -// NewKeyring returns an Agent that holds keys in memory. It is safe -// for concurrent use by multiple goroutines. -func NewKeyring() Agent { - return &keyring{} -} - -// RemoveAll removes all identities. -func (r *keyring) RemoveAll() error { - r.mu.Lock() - defer r.mu.Unlock() - if r.locked { - return errLocked - } - - r.keys = nil - return nil -} - -// Remove removes all identities with the given public key. -func (r *keyring) Remove(key ssh.PublicKey) error { - r.mu.Lock() - defer r.mu.Unlock() - if r.locked { - return errLocked - } - - want := key.Marshal() - found := false - for i := 0; i < len(r.keys); { - if bytes.Equal(r.keys[i].signer.PublicKey().Marshal(), want) { - found = true - r.keys[i] = r.keys[len(r.keys)-1] - r.keys = r.keys[len(r.keys)-1:] - continue - } else { - i++ - } - } - - if !found { - return errors.New("agent: key not found") - } - return nil -} - -// Lock locks the agent. Sign and Remove will fail, and List will empty an empty list. -func (r *keyring) Lock(passphrase []byte) error { - r.mu.Lock() - defer r.mu.Unlock() - if r.locked { - return errLocked - } - - r.locked = true - r.passphrase = passphrase - return nil -} - -// Unlock undoes the effect of Lock -func (r *keyring) Unlock(passphrase []byte) error { - r.mu.Lock() - defer r.mu.Unlock() - if !r.locked { - return errors.New("agent: not locked") - } - if len(passphrase) != len(r.passphrase) || 1 != subtle.ConstantTimeCompare(passphrase, r.passphrase) { - return fmt.Errorf("agent: incorrect passphrase") - } - - r.locked = false - r.passphrase = nil - return nil -} - -// List returns the identities known to the agent. -func (r *keyring) List() ([]*Key, error) { - r.mu.Lock() - defer r.mu.Unlock() - if r.locked { - // section 2.7: locked agents return empty. - return nil, nil - } - - var ids []*Key - for _, k := range r.keys { - pub := k.signer.PublicKey() - ids = append(ids, &Key{ - Format: pub.Type(), - Blob: pub.Marshal(), - Comment: k.comment}) - } - return ids, nil -} - -// Insert adds a private key to the keyring. If a certificate -// is given, that certificate is added as public key. -func (r *keyring) Add(priv interface{}, cert *ssh.Certificate, comment string) error { - r.mu.Lock() - defer r.mu.Unlock() - if r.locked { - return errLocked - } - signer, err := ssh.NewSignerFromKey(priv) - - if err != nil { - return err - } - - if cert != nil { - signer, err = ssh.NewCertSigner(cert, signer) - if err != nil { - return err - } - } - - r.keys = append(r.keys, privKey{signer, comment}) - - return nil -} - -// Sign returns a signature for the data. -func (r *keyring) Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) { - r.mu.Lock() - defer r.mu.Unlock() - if r.locked { - return nil, errLocked - } - - wanted := key.Marshal() - for _, k := range r.keys { - if bytes.Equal(k.signer.PublicKey().Marshal(), wanted) { - return k.signer.Sign(rand.Reader, data) - } - } - return nil, errors.New("not found") -} - -// Signers returns signers for all the known keys. -func (r *keyring) Signers() ([]ssh.Signer, error) { - r.mu.Lock() - defer r.mu.Unlock() - if r.locked { - return nil, errLocked - } - - s := make([]ssh.Signer, 0, len(r.keys)) - for _, k := range r.keys { - s = append(s, k.signer) - } - return s, nil -} diff --git a/vendor/golang.org/x/crypto/ssh/agent/server.go b/vendor/golang.org/x/crypto/ssh/agent/server.go deleted file mode 100644 index be9df0eb026..00000000000 --- a/vendor/golang.org/x/crypto/ssh/agent/server.go +++ /dev/null @@ -1,209 +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 agent - -import ( - "crypto/rsa" - "encoding/binary" - "fmt" - "io" - "log" - "math/big" - - "golang.org/x/crypto/ssh" -) - -// Server wraps an Agent and uses it to implement the agent side of -// the SSH-agent, wire protocol. -type server struct { - agent Agent -} - -func (s *server) processRequestBytes(reqData []byte) []byte { - rep, err := s.processRequest(reqData) - if err != nil { - if err != errLocked { - // TODO(hanwen): provide better logging interface? - log.Printf("agent %d: %v", reqData[0], err) - } - return []byte{agentFailure} - } - - if err == nil && rep == nil { - return []byte{agentSuccess} - } - - return ssh.Marshal(rep) -} - -func marshalKey(k *Key) []byte { - var record struct { - Blob []byte - Comment string - } - record.Blob = k.Marshal() - record.Comment = k.Comment - - return ssh.Marshal(&record) -} - -type agentV1IdentityMsg struct { - Numkeys uint32 `sshtype:"2"` -} - -type agentRemoveIdentityMsg struct { - KeyBlob []byte `sshtype:"18"` -} - -type agentLockMsg struct { - Passphrase []byte `sshtype:"22"` -} - -type agentUnlockMsg struct { - Passphrase []byte `sshtype:"23"` -} - -func (s *server) processRequest(data []byte) (interface{}, error) { - switch data[0] { - case agentRequestV1Identities: - return &agentV1IdentityMsg{0}, nil - case agentRemoveIdentity: - var req agentRemoveIdentityMsg - if err := ssh.Unmarshal(data, &req); err != nil { - return nil, err - } - - var wk wireKey - if err := ssh.Unmarshal(req.KeyBlob, &wk); err != nil { - return nil, err - } - - return nil, s.agent.Remove(&Key{Format: wk.Format, Blob: req.KeyBlob}) - - case agentRemoveAllIdentities: - return nil, s.agent.RemoveAll() - - case agentLock: - var req agentLockMsg - if err := ssh.Unmarshal(data, &req); err != nil { - return nil, err - } - - return nil, s.agent.Lock(req.Passphrase) - - case agentUnlock: - var req agentLockMsg - if err := ssh.Unmarshal(data, &req); err != nil { - return nil, err - } - return nil, s.agent.Unlock(req.Passphrase) - - case agentSignRequest: - var req signRequestAgentMsg - if err := ssh.Unmarshal(data, &req); err != nil { - return nil, err - } - - var wk wireKey - if err := ssh.Unmarshal(req.KeyBlob, &wk); err != nil { - return nil, err - } - - k := &Key{ - Format: wk.Format, - Blob: req.KeyBlob, - } - - sig, err := s.agent.Sign(k, req.Data) // TODO(hanwen): flags. - if err != nil { - return nil, err - } - return &signResponseAgentMsg{SigBlob: ssh.Marshal(sig)}, nil - case agentRequestIdentities: - keys, err := s.agent.List() - if err != nil { - return nil, err - } - - rep := identitiesAnswerAgentMsg{ - NumKeys: uint32(len(keys)), - } - for _, k := range keys { - rep.Keys = append(rep.Keys, marshalKey(k)...) - } - return rep, nil - case agentAddIdentity: - return nil, s.insertIdentity(data) - } - - return nil, fmt.Errorf("unknown opcode %d", data[0]) -} - -func (s *server) insertIdentity(req []byte) error { - var record struct { - Type string `sshtype:"17"` - Rest []byte `ssh:"rest"` - } - if err := ssh.Unmarshal(req, &record); err != nil { - return err - } - - switch record.Type { - case ssh.KeyAlgoRSA: - var k rsaKeyMsg - if err := ssh.Unmarshal(req, &k); err != nil { - return err - } - - priv := rsa.PrivateKey{ - PublicKey: rsa.PublicKey{ - E: int(k.E.Int64()), - N: k.N, - }, - D: k.D, - Primes: []*big.Int{k.P, k.Q}, - } - priv.Precompute() - - return s.agent.Add(&priv, nil, k.Comments) - } - return fmt.Errorf("not implemented: %s", record.Type) -} - -// ServeAgent serves the agent protocol on the given connection. It -// returns when an I/O error occurs. -func ServeAgent(agent Agent, c io.ReadWriter) error { - s := &server{agent} - - var length [4]byte - for { - if _, err := io.ReadFull(c, length[:]); err != nil { - return err - } - l := binary.BigEndian.Uint32(length[:]) - if l > maxAgentResponseBytes { - // We also cap requests. - return fmt.Errorf("agent: request too large: %d", l) - } - - req := make([]byte, l) - if _, err := io.ReadFull(c, req); err != nil { - return err - } - - repData := s.processRequestBytes(req) - if len(repData) > maxAgentResponseBytes { - return fmt.Errorf("agent: reply too large: %d bytes", len(repData)) - } - - binary.BigEndian.PutUint32(length[:], uint32(len(repData))) - if _, err := c.Write(length[:]); err != nil { - return err - } - if _, err := c.Write(repData); err != nil { - return err - } - } -} 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 741eeb13f0f..00000000000 --- 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 0763c9a9789..00000000000 --- 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 9c1ffd145a7..00000000000 --- 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 5883b22d780..00000000000 --- 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 2dd6c3d9788..00000000000 --- 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 29ad65e96cc..00000000000 --- 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/net/html/charset/charset.go b/vendor/golang.org/x/net/html/charset/charset.go deleted file mode 100644 index fd7eb585d82..00000000000 --- a/vendor/golang.org/x/net/html/charset/charset.go +++ /dev/null @@ -1,244 +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 charset provides common text encodings for HTML documents. -// -// The mapping from encoding labels to encodings is defined at -// https://encoding.spec.whatwg.org/. -package charset - -import ( - "bytes" - "fmt" - "io" - "mime" - "strings" - "unicode/utf8" - - "golang.org/x/net/html" - "golang.org/x/text/encoding" - "golang.org/x/text/encoding/charmap" - "golang.org/x/text/transform" -) - -// Lookup returns the encoding with the specified label, and its canonical -// name. It returns nil and the empty string if label is not one of the -// standard encodings for HTML. Matching is case-insensitive and ignores -// leading and trailing whitespace. -func Lookup(label string) (e encoding.Encoding, name string) { - label = strings.ToLower(strings.Trim(label, "\t\n\r\f ")) - enc := encodings[label] - return enc.e, enc.name -} - -// DetermineEncoding determines the encoding of an HTML document by examining -// up to the first 1024 bytes of content and the declared Content-Type. -// -// See http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#determining-the-character-encoding -func DetermineEncoding(content []byte, contentType string) (e encoding.Encoding, name string, certain bool) { - if len(content) > 1024 { - content = content[:1024] - } - - for _, b := range boms { - if bytes.HasPrefix(content, b.bom) { - e, name = Lookup(b.enc) - return e, name, true - } - } - - if _, params, err := mime.ParseMediaType(contentType); err == nil { - if cs, ok := params["charset"]; ok { - if e, name = Lookup(cs); e != nil { - return e, name, true - } - } - } - - if len(content) > 0 { - e, name = prescan(content) - if e != nil { - return e, name, false - } - } - - // Try to detect UTF-8. - // First eliminate any partial rune at the end. - for i := len(content) - 1; i >= 0 && i > len(content)-4; i-- { - b := content[i] - if b < 0x80 { - break - } - if utf8.RuneStart(b) { - content = content[:i] - break - } - } - hasHighBit := false - for _, c := range content { - if c >= 0x80 { - hasHighBit = true - break - } - } - if hasHighBit && utf8.Valid(content) { - return encoding.Nop, "utf-8", false - } - - // TODO: change default depending on user's locale? - return charmap.Windows1252, "windows-1252", false -} - -// NewReader returns an io.Reader that converts the content of r to UTF-8. -// It calls DetermineEncoding to find out what r's encoding is. -func NewReader(r io.Reader, contentType string) (io.Reader, error) { - preview := make([]byte, 1024) - n, err := io.ReadFull(r, preview) - switch { - case err == io.ErrUnexpectedEOF: - preview = preview[:n] - r = bytes.NewReader(preview) - case err != nil: - return nil, err - default: - r = io.MultiReader(bytes.NewReader(preview), r) - } - - if e, _, _ := DetermineEncoding(preview, contentType); e != encoding.Nop { - r = transform.NewReader(r, e.NewDecoder()) - } - return r, nil -} - -// NewReaderLabel returns a reader that converts from the specified charset to -// UTF-8. It uses Lookup to find the encoding that corresponds to label, and -// returns an error if Lookup returns nil. It is suitable for use as -// encoding/xml.Decoder's CharsetReader function. -func NewReaderLabel(label string, input io.Reader) (io.Reader, error) { - e, _ := Lookup(label) - if e == nil { - return nil, fmt.Errorf("unsupported charset: %q", label) - } - return transform.NewReader(input, e.NewDecoder()), nil -} - -func prescan(content []byte) (e encoding.Encoding, name string) { - z := html.NewTokenizer(bytes.NewReader(content)) - for { - switch z.Next() { - case html.ErrorToken: - return nil, "" - - case html.StartTagToken, html.SelfClosingTagToken: - tagName, hasAttr := z.TagName() - if !bytes.Equal(tagName, []byte("meta")) { - continue - } - attrList := make(map[string]bool) - gotPragma := false - - const ( - dontKnow = iota - doNeedPragma - doNotNeedPragma - ) - needPragma := dontKnow - - name = "" - e = nil - for hasAttr { - var key, val []byte - key, val, hasAttr = z.TagAttr() - ks := string(key) - if attrList[ks] { - continue - } - attrList[ks] = true - for i, c := range val { - if 'A' <= c && c <= 'Z' { - val[i] = c + 0x20 - } - } - - switch ks { - case "http-equiv": - if bytes.Equal(val, []byte("content-type")) { - gotPragma = true - } - - case "content": - if e == nil { - name = fromMetaElement(string(val)) - if name != "" { - e, name = Lookup(name) - if e != nil { - needPragma = doNeedPragma - } - } - } - - case "charset": - e, name = Lookup(string(val)) - needPragma = doNotNeedPragma - } - } - - if needPragma == dontKnow || needPragma == doNeedPragma && !gotPragma { - continue - } - - if strings.HasPrefix(name, "utf-16") { - name = "utf-8" - e = encoding.Nop - } - - if e != nil { - return e, name - } - } - } -} - -func fromMetaElement(s string) string { - for s != "" { - csLoc := strings.Index(s, "charset") - if csLoc == -1 { - return "" - } - s = s[csLoc+len("charset"):] - s = strings.TrimLeft(s, " \t\n\f\r") - if !strings.HasPrefix(s, "=") { - continue - } - s = s[1:] - s = strings.TrimLeft(s, " \t\n\f\r") - if s == "" { - return "" - } - if q := s[0]; q == '"' || q == '\'' { - s = s[1:] - closeQuote := strings.IndexRune(s, rune(q)) - if closeQuote == -1 { - return "" - } - return s[:closeQuote] - } - - end := strings.IndexAny(s, "; \t\n\f\r") - if end == -1 { - end = len(s) - } - return s[:end] - } - return "" -} - -var boms = []struct { - bom []byte - enc string -}{ - {[]byte{0xfe, 0xff}, "utf-16be"}, - {[]byte{0xff, 0xfe}, "utf-16le"}, - {[]byte{0xef, 0xbb, 0xbf}, "utf-8"}, -} diff --git a/vendor/golang.org/x/net/html/charset/gen.go b/vendor/golang.org/x/net/html/charset/gen.go deleted file mode 100644 index 828347f4aec..00000000000 --- a/vendor/golang.org/x/net/html/charset/gen.go +++ /dev/null @@ -1,111 +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 ignore - -package main - -// Download https://encoding.spec.whatwg.org/encodings.json and use it to -// generate table.go. - -import ( - "encoding/json" - "fmt" - "log" - "net/http" - "strings" -) - -type enc struct { - Name string - Labels []string -} - -type group struct { - Encodings []enc - Heading string -} - -const specURL = "https://encoding.spec.whatwg.org/encodings.json" - -func main() { - resp, err := http.Get(specURL) - if err != nil { - log.Fatalf("error fetching %s: %s", specURL, err) - } - if resp.StatusCode != 200 { - log.Fatalf("error fetching %s: HTTP status %s", specURL, resp.Status) - } - defer resp.Body.Close() - - var groups []group - d := json.NewDecoder(resp.Body) - err = d.Decode(&groups) - if err != nil { - log.Fatalf("error reading encodings.json: %s", err) - } - - fmt.Println("// generated by go run gen.go; DO NOT EDIT") - fmt.Println() - fmt.Println("package charset") - fmt.Println() - - fmt.Println("import (") - fmt.Println(`"golang.org/x/text/encoding"`) - for _, pkg := range []string{"charmap", "japanese", "korean", "simplifiedchinese", "traditionalchinese", "unicode"} { - fmt.Printf("\"golang.org/x/text/encoding/%s\"\n", pkg) - } - fmt.Println(")") - fmt.Println() - - fmt.Println("var encodings = map[string]struct{e encoding.Encoding; name string} {") - for _, g := range groups { - for _, e := range g.Encodings { - goName, ok := miscNames[e.Name] - if !ok { - for k, v := range prefixes { - if strings.HasPrefix(e.Name, k) { - goName = v + e.Name[len(k):] - break - } - } - if goName == "" { - log.Fatalf("unrecognized encoding name: %s", e.Name) - } - } - - for _, label := range e.Labels { - fmt.Printf("%q: {%s, %q},\n", label, goName, e.Name) - } - } - } - fmt.Println("}") -} - -var prefixes = map[string]string{ - "iso-8859-": "charmap.ISO8859_", - "windows-": "charmap.Windows", -} - -var miscNames = map[string]string{ - "utf-8": "encoding.Nop", - "ibm866": "charmap.CodePage866", - "iso-8859-8-i": "charmap.ISO8859_8", - "koi8-r": "charmap.KOI8R", - "koi8-u": "charmap.KOI8U", - "macintosh": "charmap.Macintosh", - "x-mac-cyrillic": "charmap.MacintoshCyrillic", - "gbk": "simplifiedchinese.GBK", - "gb18030": "simplifiedchinese.GB18030", - "hz-gb-2312": "simplifiedchinese.HZGB2312", - "big5": "traditionalchinese.Big5", - "euc-jp": "japanese.EUCJP", - "iso-2022-jp": "japanese.ISO2022JP", - "shift_jis": "japanese.ShiftJIS", - "euc-kr": "korean.EUCKR", - "replacement": "encoding.Replacement", - "utf-16be": "unicode.UTF16(unicode.BigEndian, unicode.IgnoreBOM)", - "utf-16le": "unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM)", - "x-user-defined": "charmap.XUserDefined", -} diff --git a/vendor/golang.org/x/net/html/charset/table.go b/vendor/golang.org/x/net/html/charset/table.go deleted file mode 100644 index aa0d9484071..00000000000 --- a/vendor/golang.org/x/net/html/charset/table.go +++ /dev/null @@ -1,235 +0,0 @@ -// generated by go run gen.go; DO NOT EDIT - -package charset - -import ( - "golang.org/x/text/encoding" - "golang.org/x/text/encoding/charmap" - "golang.org/x/text/encoding/japanese" - "golang.org/x/text/encoding/korean" - "golang.org/x/text/encoding/simplifiedchinese" - "golang.org/x/text/encoding/traditionalchinese" - "golang.org/x/text/encoding/unicode" -) - -var encodings = map[string]struct { - e encoding.Encoding - name string -}{ - "unicode-1-1-utf-8": {encoding.Nop, "utf-8"}, - "utf-8": {encoding.Nop, "utf-8"}, - "utf8": {encoding.Nop, "utf-8"}, - "866": {charmap.CodePage866, "ibm866"}, - "cp866": {charmap.CodePage866, "ibm866"}, - "csibm866": {charmap.CodePage866, "ibm866"}, - "ibm866": {charmap.CodePage866, "ibm866"}, - "csisolatin2": {charmap.ISO8859_2, "iso-8859-2"}, - "iso-8859-2": {charmap.ISO8859_2, "iso-8859-2"}, - "iso-ir-101": {charmap.ISO8859_2, "iso-8859-2"}, - "iso8859-2": {charmap.ISO8859_2, "iso-8859-2"}, - "iso88592": {charmap.ISO8859_2, "iso-8859-2"}, - "iso_8859-2": {charmap.ISO8859_2, "iso-8859-2"}, - "iso_8859-2:1987": {charmap.ISO8859_2, "iso-8859-2"}, - "l2": {charmap.ISO8859_2, "iso-8859-2"}, - "latin2": {charmap.ISO8859_2, "iso-8859-2"}, - "csisolatin3": {charmap.ISO8859_3, "iso-8859-3"}, - "iso-8859-3": {charmap.ISO8859_3, "iso-8859-3"}, - "iso-ir-109": {charmap.ISO8859_3, "iso-8859-3"}, - "iso8859-3": {charmap.ISO8859_3, "iso-8859-3"}, - "iso88593": {charmap.ISO8859_3, "iso-8859-3"}, - "iso_8859-3": {charmap.ISO8859_3, "iso-8859-3"}, - "iso_8859-3:1988": {charmap.ISO8859_3, "iso-8859-3"}, - "l3": {charmap.ISO8859_3, "iso-8859-3"}, - "latin3": {charmap.ISO8859_3, "iso-8859-3"}, - "csisolatin4": {charmap.ISO8859_4, "iso-8859-4"}, - "iso-8859-4": {charmap.ISO8859_4, "iso-8859-4"}, - "iso-ir-110": {charmap.ISO8859_4, "iso-8859-4"}, - "iso8859-4": {charmap.ISO8859_4, "iso-8859-4"}, - "iso88594": {charmap.ISO8859_4, "iso-8859-4"}, - "iso_8859-4": {charmap.ISO8859_4, "iso-8859-4"}, - "iso_8859-4:1988": {charmap.ISO8859_4, "iso-8859-4"}, - "l4": {charmap.ISO8859_4, "iso-8859-4"}, - "latin4": {charmap.ISO8859_4, "iso-8859-4"}, - "csisolatincyrillic": {charmap.ISO8859_5, "iso-8859-5"}, - "cyrillic": {charmap.ISO8859_5, "iso-8859-5"}, - "iso-8859-5": {charmap.ISO8859_5, "iso-8859-5"}, - "iso-ir-144": {charmap.ISO8859_5, "iso-8859-5"}, - "iso8859-5": {charmap.ISO8859_5, "iso-8859-5"}, - "iso88595": {charmap.ISO8859_5, "iso-8859-5"}, - "iso_8859-5": {charmap.ISO8859_5, "iso-8859-5"}, - "iso_8859-5:1988": {charmap.ISO8859_5, "iso-8859-5"}, - "arabic": {charmap.ISO8859_6, "iso-8859-6"}, - "asmo-708": {charmap.ISO8859_6, "iso-8859-6"}, - "csiso88596e": {charmap.ISO8859_6, "iso-8859-6"}, - "csiso88596i": {charmap.ISO8859_6, "iso-8859-6"}, - "csisolatinarabic": {charmap.ISO8859_6, "iso-8859-6"}, - "ecma-114": {charmap.ISO8859_6, "iso-8859-6"}, - "iso-8859-6": {charmap.ISO8859_6, "iso-8859-6"}, - "iso-8859-6-e": {charmap.ISO8859_6, "iso-8859-6"}, - "iso-8859-6-i": {charmap.ISO8859_6, "iso-8859-6"}, - "iso-ir-127": {charmap.ISO8859_6, "iso-8859-6"}, - "iso8859-6": {charmap.ISO8859_6, "iso-8859-6"}, - "iso88596": {charmap.ISO8859_6, "iso-8859-6"}, - "iso_8859-6": {charmap.ISO8859_6, "iso-8859-6"}, - "iso_8859-6:1987": {charmap.ISO8859_6, "iso-8859-6"}, - "csisolatingreek": {charmap.ISO8859_7, "iso-8859-7"}, - "ecma-118": {charmap.ISO8859_7, "iso-8859-7"}, - "elot_928": {charmap.ISO8859_7, "iso-8859-7"}, - "greek": {charmap.ISO8859_7, "iso-8859-7"}, - "greek8": {charmap.ISO8859_7, "iso-8859-7"}, - "iso-8859-7": {charmap.ISO8859_7, "iso-8859-7"}, - "iso-ir-126": {charmap.ISO8859_7, "iso-8859-7"}, - "iso8859-7": {charmap.ISO8859_7, "iso-8859-7"}, - "iso88597": {charmap.ISO8859_7, "iso-8859-7"}, - "iso_8859-7": {charmap.ISO8859_7, "iso-8859-7"}, - "iso_8859-7:1987": {charmap.ISO8859_7, "iso-8859-7"}, - "sun_eu_greek": {charmap.ISO8859_7, "iso-8859-7"}, - "csiso88598e": {charmap.ISO8859_8, "iso-8859-8"}, - "csisolatinhebrew": {charmap.ISO8859_8, "iso-8859-8"}, - "hebrew": {charmap.ISO8859_8, "iso-8859-8"}, - "iso-8859-8": {charmap.ISO8859_8, "iso-8859-8"}, - "iso-8859-8-e": {charmap.ISO8859_8, "iso-8859-8"}, - "iso-ir-138": {charmap.ISO8859_8, "iso-8859-8"}, - "iso8859-8": {charmap.ISO8859_8, "iso-8859-8"}, - "iso88598": {charmap.ISO8859_8, "iso-8859-8"}, - "iso_8859-8": {charmap.ISO8859_8, "iso-8859-8"}, - "iso_8859-8:1988": {charmap.ISO8859_8, "iso-8859-8"}, - "visual": {charmap.ISO8859_8, "iso-8859-8"}, - "csiso88598i": {charmap.ISO8859_8, "iso-8859-8-i"}, - "iso-8859-8-i": {charmap.ISO8859_8, "iso-8859-8-i"}, - "logical": {charmap.ISO8859_8, "iso-8859-8-i"}, - "csisolatin6": {charmap.ISO8859_10, "iso-8859-10"}, - "iso-8859-10": {charmap.ISO8859_10, "iso-8859-10"}, - "iso-ir-157": {charmap.ISO8859_10, "iso-8859-10"}, - "iso8859-10": {charmap.ISO8859_10, "iso-8859-10"}, - "iso885910": {charmap.ISO8859_10, "iso-8859-10"}, - "l6": {charmap.ISO8859_10, "iso-8859-10"}, - "latin6": {charmap.ISO8859_10, "iso-8859-10"}, - "iso-8859-13": {charmap.ISO8859_13, "iso-8859-13"}, - "iso8859-13": {charmap.ISO8859_13, "iso-8859-13"}, - "iso885913": {charmap.ISO8859_13, "iso-8859-13"}, - "iso-8859-14": {charmap.ISO8859_14, "iso-8859-14"}, - "iso8859-14": {charmap.ISO8859_14, "iso-8859-14"}, - "iso885914": {charmap.ISO8859_14, "iso-8859-14"}, - "csisolatin9": {charmap.ISO8859_15, "iso-8859-15"}, - "iso-8859-15": {charmap.ISO8859_15, "iso-8859-15"}, - "iso8859-15": {charmap.ISO8859_15, "iso-8859-15"}, - "iso885915": {charmap.ISO8859_15, "iso-8859-15"}, - "iso_8859-15": {charmap.ISO8859_15, "iso-8859-15"}, - "l9": {charmap.ISO8859_15, "iso-8859-15"}, - "iso-8859-16": {charmap.ISO8859_16, "iso-8859-16"}, - "cskoi8r": {charmap.KOI8R, "koi8-r"}, - "koi": {charmap.KOI8R, "koi8-r"}, - "koi8": {charmap.KOI8R, "koi8-r"}, - "koi8-r": {charmap.KOI8R, "koi8-r"}, - "koi8_r": {charmap.KOI8R, "koi8-r"}, - "koi8-u": {charmap.KOI8U, "koi8-u"}, - "csmacintosh": {charmap.Macintosh, "macintosh"}, - "mac": {charmap.Macintosh, "macintosh"}, - "macintosh": {charmap.Macintosh, "macintosh"}, - "x-mac-roman": {charmap.Macintosh, "macintosh"}, - "dos-874": {charmap.Windows874, "windows-874"}, - "iso-8859-11": {charmap.Windows874, "windows-874"}, - "iso8859-11": {charmap.Windows874, "windows-874"}, - "iso885911": {charmap.Windows874, "windows-874"}, - "tis-620": {charmap.Windows874, "windows-874"}, - "windows-874": {charmap.Windows874, "windows-874"}, - "cp1250": {charmap.Windows1250, "windows-1250"}, - "windows-1250": {charmap.Windows1250, "windows-1250"}, - "x-cp1250": {charmap.Windows1250, "windows-1250"}, - "cp1251": {charmap.Windows1251, "windows-1251"}, - "windows-1251": {charmap.Windows1251, "windows-1251"}, - "x-cp1251": {charmap.Windows1251, "windows-1251"}, - "ansi_x3.4-1968": {charmap.Windows1252, "windows-1252"}, - "ascii": {charmap.Windows1252, "windows-1252"}, - "cp1252": {charmap.Windows1252, "windows-1252"}, - "cp819": {charmap.Windows1252, "windows-1252"}, - "csisolatin1": {charmap.Windows1252, "windows-1252"}, - "ibm819": {charmap.Windows1252, "windows-1252"}, - "iso-8859-1": {charmap.Windows1252, "windows-1252"}, - "iso-ir-100": {charmap.Windows1252, "windows-1252"}, - "iso8859-1": {charmap.Windows1252, "windows-1252"}, - "iso88591": {charmap.Windows1252, "windows-1252"}, - "iso_8859-1": {charmap.Windows1252, "windows-1252"}, - "iso_8859-1:1987": {charmap.Windows1252, "windows-1252"}, - "l1": {charmap.Windows1252, "windows-1252"}, - "latin1": {charmap.Windows1252, "windows-1252"}, - "us-ascii": {charmap.Windows1252, "windows-1252"}, - "windows-1252": {charmap.Windows1252, "windows-1252"}, - "x-cp1252": {charmap.Windows1252, "windows-1252"}, - "cp1253": {charmap.Windows1253, "windows-1253"}, - "windows-1253": {charmap.Windows1253, "windows-1253"}, - "x-cp1253": {charmap.Windows1253, "windows-1253"}, - "cp1254": {charmap.Windows1254, "windows-1254"}, - "csisolatin5": {charmap.Windows1254, "windows-1254"}, - "iso-8859-9": {charmap.Windows1254, "windows-1254"}, - "iso-ir-148": {charmap.Windows1254, "windows-1254"}, - "iso8859-9": {charmap.Windows1254, "windows-1254"}, - "iso88599": {charmap.Windows1254, "windows-1254"}, - "iso_8859-9": {charmap.Windows1254, "windows-1254"}, - "iso_8859-9:1989": {charmap.Windows1254, "windows-1254"}, - "l5": {charmap.Windows1254, "windows-1254"}, - "latin5": {charmap.Windows1254, "windows-1254"}, - "windows-1254": {charmap.Windows1254, "windows-1254"}, - "x-cp1254": {charmap.Windows1254, "windows-1254"}, - "cp1255": {charmap.Windows1255, "windows-1255"}, - "windows-1255": {charmap.Windows1255, "windows-1255"}, - "x-cp1255": {charmap.Windows1255, "windows-1255"}, - "cp1256": {charmap.Windows1256, "windows-1256"}, - "windows-1256": {charmap.Windows1256, "windows-1256"}, - "x-cp1256": {charmap.Windows1256, "windows-1256"}, - "cp1257": {charmap.Windows1257, "windows-1257"}, - "windows-1257": {charmap.Windows1257, "windows-1257"}, - "x-cp1257": {charmap.Windows1257, "windows-1257"}, - "cp1258": {charmap.Windows1258, "windows-1258"}, - "windows-1258": {charmap.Windows1258, "windows-1258"}, - "x-cp1258": {charmap.Windows1258, "windows-1258"}, - "x-mac-cyrillic": {charmap.MacintoshCyrillic, "x-mac-cyrillic"}, - "x-mac-ukrainian": {charmap.MacintoshCyrillic, "x-mac-cyrillic"}, - "chinese": {simplifiedchinese.GBK, "gbk"}, - "csgb2312": {simplifiedchinese.GBK, "gbk"}, - "csiso58gb231280": {simplifiedchinese.GBK, "gbk"}, - "gb2312": {simplifiedchinese.GBK, "gbk"}, - "gb_2312": {simplifiedchinese.GBK, "gbk"}, - "gb_2312-80": {simplifiedchinese.GBK, "gbk"}, - "gbk": {simplifiedchinese.GBK, "gbk"}, - "iso-ir-58": {simplifiedchinese.GBK, "gbk"}, - "x-gbk": {simplifiedchinese.GBK, "gbk"}, - "gb18030": {simplifiedchinese.GB18030, "gb18030"}, - "hz-gb-2312": {simplifiedchinese.HZGB2312, "hz-gb-2312"}, - "big5": {traditionalchinese.Big5, "big5"}, - "big5-hkscs": {traditionalchinese.Big5, "big5"}, - "cn-big5": {traditionalchinese.Big5, "big5"}, - "csbig5": {traditionalchinese.Big5, "big5"}, - "x-x-big5": {traditionalchinese.Big5, "big5"}, - "cseucpkdfmtjapanese": {japanese.EUCJP, "euc-jp"}, - "euc-jp": {japanese.EUCJP, "euc-jp"}, - "x-euc-jp": {japanese.EUCJP, "euc-jp"}, - "csiso2022jp": {japanese.ISO2022JP, "iso-2022-jp"}, - "iso-2022-jp": {japanese.ISO2022JP, "iso-2022-jp"}, - "csshiftjis": {japanese.ShiftJIS, "shift_jis"}, - "ms_kanji": {japanese.ShiftJIS, "shift_jis"}, - "shift-jis": {japanese.ShiftJIS, "shift_jis"}, - "shift_jis": {japanese.ShiftJIS, "shift_jis"}, - "sjis": {japanese.ShiftJIS, "shift_jis"}, - "windows-31j": {japanese.ShiftJIS, "shift_jis"}, - "x-sjis": {japanese.ShiftJIS, "shift_jis"}, - "cseuckr": {korean.EUCKR, "euc-kr"}, - "csksc56011987": {korean.EUCKR, "euc-kr"}, - "euc-kr": {korean.EUCKR, "euc-kr"}, - "iso-ir-149": {korean.EUCKR, "euc-kr"}, - "korean": {korean.EUCKR, "euc-kr"}, - "ks_c_5601-1987": {korean.EUCKR, "euc-kr"}, - "ks_c_5601-1989": {korean.EUCKR, "euc-kr"}, - "ksc5601": {korean.EUCKR, "euc-kr"}, - "ksc_5601": {korean.EUCKR, "euc-kr"}, - "windows-949": {korean.EUCKR, "euc-kr"}, - "csiso2022kr": {encoding.Replacement, "replacement"}, - "iso-2022-kr": {encoding.Replacement, "replacement"}, - "iso-2022-cn": {encoding.Replacement, "replacement"}, - "iso-2022-cn-ext": {encoding.Replacement, "replacement"}, - "utf-16be": {unicode.UTF16(unicode.BigEndian, unicode.IgnoreBOM), "utf-16be"}, - "utf-16": {unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM), "utf-16le"}, - "utf-16le": {unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM), "utf-16le"}, - "x-user-defined": {charmap.XUserDefined, "x-user-defined"}, -} diff --git a/vendor/golang.org/x/net/http2/h2demo/.gitignore b/vendor/golang.org/x/net/http2/h2demo/.gitignore deleted file mode 100644 index 0de86ddbc5f..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -h2demo -h2demo.linux -client-id.dat -client-secret.dat -token.dat diff --git a/vendor/golang.org/x/net/http2/h2demo/Makefile b/vendor/golang.org/x/net/http2/h2demo/Makefile deleted file mode 100644 index 3a77cf073c0..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -h2demo.linux: h2demo.go - GOOS=linux go build --tags=h2demo -o h2demo.linux . - -upload: h2demo.linux - cat h2demo.linux | go run launch.go --write_object=http2-demo-server-tls/h2demo --write_object_is_public diff --git a/vendor/golang.org/x/net/http2/h2demo/README b/vendor/golang.org/x/net/http2/h2demo/README deleted file mode 100644 index 212a96f3835..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/README +++ /dev/null @@ -1,16 +0,0 @@ - -Client: - -- Firefox nightly with about:config network.http.spdy.enabled.http2draft set true - -- Chrome: go to chrome://flags/#enable-spdy4, save and restart (button at bottom) - -Make CA: -$ openssl genrsa -out rootCA.key 2048 -$ openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.pem -... install that to Firefox - -Make cert: -$ openssl genrsa -out server.key 2048 -$ openssl req -new -key server.key -out server.csr -$ openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 - - diff --git a/vendor/golang.org/x/net/http2/h2demo/h2demo.go b/vendor/golang.org/x/net/http2/h2demo/h2demo.go deleted file mode 100644 index 9429a725458..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/h2demo.go +++ /dev/null @@ -1,435 +0,0 @@ -// Copyright 2014 The Go Authors. -// See https://code.google.com/p/go/source/browse/CONTRIBUTORS -// Licensed under the same terms as Go itself: -// https://code.google.com/p/go/source/browse/LICENSE - -// +build h2demo - -package main - -import ( - "bytes" - "crypto/tls" - "flag" - "fmt" - "hash/crc32" - "image" - "image/jpeg" - "io" - "io/ioutil" - "log" - "net" - "net/http" - "os/exec" - "path" - "regexp" - "runtime" - "strconv" - "strings" - "sync" - "time" - - "camlistore.org/pkg/googlestorage" - "camlistore.org/pkg/singleflight" - "golang.org/x/net/http2" -) - -var ( - openFirefox = flag.Bool("openff", false, "Open Firefox") - addr = flag.String("addr", "localhost:4430", "TLS address to listen on") - httpAddr = flag.String("httpaddr", "", "If non-empty, address to listen for regular HTTP on") - prod = flag.Bool("prod", false, "Whether to configure itself to be the production http2.golang.org server.") -) - -func homeOldHTTP(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, ` - -

Go + HTTP/2

-

Welcome to the Go language's HTTP/2 demo & interop server.

-

Unfortunately, you're not using HTTP/2 right now. To do so:

-
    -
  • Use Firefox Nightly or go to about:config and enable "network.http.spdy.enabled.http2draft"
  • -
  • Use Google Chrome Canary and/or go to chrome://flags/#enable-spdy4 to Enable SPDY/4 (Chrome's name for HTTP/2)
  • -
-

See code & instructions for connecting at https://github.com/golang/net/tree/master/http2.

- -`) -} - -func home(w http.ResponseWriter, r *http.Request) { - if r.URL.Path != "/" { - http.NotFound(w, r) - return - } - io.WriteString(w, ` - -

Go + HTTP/2

- -

Welcome to the Go language's HTTP/2 demo & interop server.

- -

Congratulations, you're using HTTP/2 right now.

- -

This server exists for others in the HTTP/2 community to test their HTTP/2 client implementations and point out flaws in our server.

- -

The code is currently at github.com/bradfitz/http2 -but will move to the Go standard library at some point in the future -(enabled by default, without users needing to change their code).

- -

Contact info: bradfitz@golang.org, or file a bug.

- -

Handlers for testing

-
    -
  • GET /reqinfo to dump the request + headers received
  • -
  • GET /clockstream streams the current time every second
  • -
  • GET /gophertiles to see a page with a bunch of images
  • -
  • GET /file/gopher.png for a small file (does If-Modified-Since, Content-Range, etc)
  • -
  • GET /file/go.src.tar.gz for a larger file (~10 MB)
  • -
  • GET /redirect to redirect back to / (this page)
  • -
  • GET /goroutines to see all active goroutines in this server
  • -
  • PUT something to /crc32 to get a count of number of bytes and its CRC-32
  • -
- -`) -} - -func reqInfoHandler(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - fmt.Fprintf(w, "Method: %s\n", r.Method) - fmt.Fprintf(w, "Protocol: %s\n", r.Proto) - fmt.Fprintf(w, "Host: %s\n", r.Host) - fmt.Fprintf(w, "RemoteAddr: %s\n", r.RemoteAddr) - fmt.Fprintf(w, "RequestURI: %q\n", r.RequestURI) - fmt.Fprintf(w, "URL: %#v\n", r.URL) - fmt.Fprintf(w, "Body.ContentLength: %d (-1 means unknown)\n", r.ContentLength) - fmt.Fprintf(w, "Close: %v (relevant for HTTP/1 only)\n", r.Close) - fmt.Fprintf(w, "TLS: %#v\n", r.TLS) - fmt.Fprintf(w, "\nHeaders:\n") - r.Header.Write(w) -} - -func crcHandler(w http.ResponseWriter, r *http.Request) { - if r.Method != "PUT" { - http.Error(w, "PUT required.", 400) - return - } - crc := crc32.NewIEEE() - n, err := io.Copy(crc, r.Body) - if err == nil { - w.Header().Set("Content-Type", "text/plain") - fmt.Fprintf(w, "bytes=%d, CRC32=%x", n, crc.Sum(nil)) - } -} - -var ( - fsGrp singleflight.Group - fsMu sync.Mutex // guards fsCache - fsCache = map[string]http.Handler{} -) - -// fileServer returns a file-serving handler that proxies URL. -// It lazily fetches URL on the first access and caches its contents forever. -func fileServer(url string) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - hi, err := fsGrp.Do(url, func() (interface{}, error) { - fsMu.Lock() - if h, ok := fsCache[url]; ok { - fsMu.Unlock() - return h, nil - } - fsMu.Unlock() - - res, err := http.Get(url) - if err != nil { - return nil, err - } - defer res.Body.Close() - slurp, err := ioutil.ReadAll(res.Body) - if err != nil { - return nil, err - } - - modTime := time.Now() - var h http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - http.ServeContent(w, r, path.Base(url), modTime, bytes.NewReader(slurp)) - }) - fsMu.Lock() - fsCache[url] = h - fsMu.Unlock() - return h, nil - }) - if err != nil { - http.Error(w, err.Error(), 500) - return - } - hi.(http.Handler).ServeHTTP(w, r) - }) -} - -func clockStreamHandler(w http.ResponseWriter, r *http.Request) { - clientGone := w.(http.CloseNotifier).CloseNotify() - w.Header().Set("Content-Type", "text/plain") - ticker := time.NewTicker(1 * time.Second) - defer ticker.Stop() - fmt.Fprintf(w, "# ~1KB of junk to force browsers to start rendering immediately: \n") - io.WriteString(w, strings.Repeat("# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n", 13)) - - for { - fmt.Fprintf(w, "%v\n", time.Now()) - w.(http.Flusher).Flush() - select { - case <-ticker.C: - case <-clientGone: - log.Printf("Client %v disconnected from the clock", r.RemoteAddr) - return - } - } -} - -func registerHandlers() { - tiles := newGopherTilesHandler() - - mux2 := http.NewServeMux() - http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - if r.TLS == nil { - if r.URL.Path == "/gophertiles" { - tiles.ServeHTTP(w, r) - return - } - http.Redirect(w, r, "https://http2.golang.org/", http.StatusFound) - return - } - if r.ProtoMajor == 1 { - if r.URL.Path == "/reqinfo" { - reqInfoHandler(w, r) - return - } - homeOldHTTP(w, r) - return - } - mux2.ServeHTTP(w, r) - }) - mux2.HandleFunc("/", home) - mux2.Handle("/file/gopher.png", fileServer("https://golang.org/doc/gopher/frontpage.png")) - mux2.Handle("/file/go.src.tar.gz", fileServer("https://storage.googleapis.com/golang/go1.4.1.src.tar.gz")) - mux2.HandleFunc("/reqinfo", reqInfoHandler) - mux2.HandleFunc("/crc32", crcHandler) - mux2.HandleFunc("/clockstream", clockStreamHandler) - mux2.Handle("/gophertiles", tiles) - mux2.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, "/", http.StatusFound) - }) - stripHomedir := regexp.MustCompile(`/(Users|home)/\w+`) - mux2.HandleFunc("/goroutines", func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain; charset=utf-8") - buf := make([]byte, 2<<20) - w.Write(stripHomedir.ReplaceAll(buf[:runtime.Stack(buf, true)], nil)) - }) -} - -func newGopherTilesHandler() http.Handler { - const gopherURL = "https://blog.golang.org/go-programming-language-turns-two_gophers.jpg" - res, err := http.Get(gopherURL) - if err != nil { - log.Fatal(err) - } - if res.StatusCode != 200 { - log.Fatalf("Error fetching %s: %v", gopherURL, res.Status) - } - slurp, err := ioutil.ReadAll(res.Body) - res.Body.Close() - if err != nil { - log.Fatal(err) - } - im, err := jpeg.Decode(bytes.NewReader(slurp)) - if err != nil { - if len(slurp) > 1024 { - slurp = slurp[:1024] - } - log.Fatalf("Failed to decode gopher image: %v (got %q)", err, slurp) - } - - type subImager interface { - SubImage(image.Rectangle) image.Image - } - const tileSize = 32 - xt := im.Bounds().Max.X / tileSize - yt := im.Bounds().Max.Y / tileSize - var tile [][][]byte // y -> x -> jpeg bytes - for yi := 0; yi < yt; yi++ { - var row [][]byte - for xi := 0; xi < xt; xi++ { - si := im.(subImager).SubImage(image.Rectangle{ - Min: image.Point{xi * tileSize, yi * tileSize}, - Max: image.Point{(xi + 1) * tileSize, (yi + 1) * tileSize}, - }) - buf := new(bytes.Buffer) - if err := jpeg.Encode(buf, si, &jpeg.Options{Quality: 90}); err != nil { - log.Fatal(err) - } - row = append(row, buf.Bytes()) - } - tile = append(tile, row) - } - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ms, _ := strconv.Atoi(r.FormValue("latency")) - const nanosPerMilli = 1e6 - if r.FormValue("x") != "" { - x, _ := strconv.Atoi(r.FormValue("x")) - y, _ := strconv.Atoi(r.FormValue("y")) - if ms <= 1000 { - time.Sleep(time.Duration(ms) * nanosPerMilli) - } - if x >= 0 && x < xt && y >= 0 && y < yt { - http.ServeContent(w, r, "", time.Time{}, bytes.NewReader(tile[y][x])) - return - } - } - io.WriteString(w, "") - fmt.Fprintf(w, "A grid of %d tiled images is below. Compare:

", xt*yt) - for _, ms := range []int{0, 30, 200, 1000} { - d := time.Duration(ms) * nanosPerMilli - fmt.Fprintf(w, "[HTTP/2, %v latency] [HTTP/1, %v latency]
\n", - httpsHost(), ms, d, - httpHost(), ms, d, - ) - } - io.WriteString(w, "

\n") - cacheBust := time.Now().UnixNano() - for y := 0; y < yt; y++ { - for x := 0; x < xt; x++ { - fmt.Fprintf(w, "", - tileSize, tileSize, x, y, cacheBust, ms) - } - io.WriteString(w, "
\n") - } - io.WriteString(w, `

- -
<< Back to Go HTTP/2 demo server`) - }) -} - -func httpsHost() string { - if *prod { - return "http2.golang.org" - } - if v := *addr; strings.HasPrefix(v, ":") { - return "localhost" + v - } else { - return v - } -} - -func httpHost() string { - if *prod { - return "http2.golang.org" - } - if v := *httpAddr; strings.HasPrefix(v, ":") { - return "localhost" + v - } else { - return v - } -} - -func serveProdTLS() error { - c, err := googlestorage.NewServiceClient() - if err != nil { - return err - } - slurp := func(key string) ([]byte, error) { - const bucket = "http2-demo-server-tls" - rc, _, err := c.GetObject(&googlestorage.Object{ - Bucket: bucket, - Key: key, - }) - if err != nil { - return nil, fmt.Errorf("Error fetching GCS object %q in bucket %q: %v", key, bucket, err) - } - defer rc.Close() - return ioutil.ReadAll(rc) - } - certPem, err := slurp("http2.golang.org.chained.pem") - if err != nil { - return err - } - keyPem, err := slurp("http2.golang.org.key") - if err != nil { - return err - } - cert, err := tls.X509KeyPair(certPem, keyPem) - if err != nil { - return err - } - srv := &http.Server{ - TLSConfig: &tls.Config{ - Certificates: []tls.Certificate{cert}, - }, - } - http2.ConfigureServer(srv, &http2.Server{}) - ln, err := net.Listen("tcp", ":443") - if err != nil { - return err - } - return srv.Serve(tls.NewListener(tcpKeepAliveListener{ln.(*net.TCPListener)}, srv.TLSConfig)) -} - -type tcpKeepAliveListener struct { - *net.TCPListener -} - -func (ln tcpKeepAliveListener) Accept() (c net.Conn, err error) { - tc, err := ln.AcceptTCP() - if err != nil { - return - } - tc.SetKeepAlive(true) - tc.SetKeepAlivePeriod(3 * time.Minute) - return tc, nil -} - -func serveProd() error { - errc := make(chan error, 2) - go func() { errc <- http.ListenAndServe(":80", nil) }() - go func() { errc <- serveProdTLS() }() - return <-errc -} - -func main() { - var srv http.Server - flag.BoolVar(&http2.VerboseLogs, "verbose", false, "Verbose HTTP/2 debugging.") - flag.Parse() - srv.Addr = *addr - - registerHandlers() - - if *prod { - *httpAddr = "http2.golang.org" - log.Fatal(serveProd()) - } - - url := "https://" + *addr + "/" - log.Printf("Listening on " + url) - http2.ConfigureServer(&srv, &http2.Server{}) - - if *httpAddr != "" { - go func() { log.Fatal(http.ListenAndServe(*httpAddr, nil)) }() - } - - go func() { - log.Fatal(srv.ListenAndServeTLS("server.crt", "server.key")) - }() - if *openFirefox && runtime.GOOS == "darwin" { - time.Sleep(250 * time.Millisecond) - exec.Command("open", "-b", "org.mozilla.nightly", "https://localhost:4430/").Run() - } - select {} -} diff --git a/vendor/golang.org/x/net/http2/h2demo/launch.go b/vendor/golang.org/x/net/http2/h2demo/launch.go deleted file mode 100644 index 746661543ea..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/launch.go +++ /dev/null @@ -1,302 +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 ignore - -package main - -import ( - "bufio" - "bytes" - "encoding/json" - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "net/http" - "os" - "strings" - "time" - - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" - compute "google.golang.org/api/compute/v1" -) - -var ( - proj = flag.String("project", "symbolic-datum-552", "name of Project") - zone = flag.String("zone", "us-central1-a", "GCE zone") - mach = flag.String("machinetype", "n1-standard-1", "Machine type") - instName = flag.String("instance_name", "http2-demo", "Name of VM instance.") - sshPub = flag.String("ssh_public_key", "", "ssh public key file to authorize. Can modify later in Google's web UI anyway.") - staticIP = flag.String("static_ip", "130.211.116.44", "Static IP to use. If empty, automatic.") - - writeObject = flag.String("write_object", "", "If non-empty, a VM isn't created and the flag value is Google Cloud Storage bucket/object to write. The contents from stdin.") - publicObject = flag.Bool("write_object_is_public", false, "Whether the object created by --write_object should be public.") -) - -func readFile(v string) string { - slurp, err := ioutil.ReadFile(v) - if err != nil { - log.Fatalf("Error reading %s: %v", v, err) - } - return strings.TrimSpace(string(slurp)) -} - -var config = &oauth2.Config{ - // The client-id and secret should be for an "Installed Application" when using - // the CLI. Later we'll use a web application with a callback. - ClientID: readFile("client-id.dat"), - ClientSecret: readFile("client-secret.dat"), - Endpoint: google.Endpoint, - Scopes: []string{ - compute.DevstorageFull_controlScope, - compute.ComputeScope, - "https://www.googleapis.com/auth/sqlservice", - "https://www.googleapis.com/auth/sqlservice.admin", - }, - RedirectURL: "urn:ietf:wg:oauth:2.0:oob", -} - -const baseConfig = `#cloud-config -coreos: - units: - - name: h2demo.service - command: start - content: | - [Unit] - Description=HTTP2 Demo - - [Service] - ExecStartPre=/bin/bash -c 'mkdir -p /opt/bin && curl -s -o /opt/bin/h2demo http://storage.googleapis.com/http2-demo-server-tls/h2demo && chmod +x /opt/bin/h2demo' - ExecStart=/opt/bin/h2demo --prod - RestartSec=5s - Restart=always - Type=simple - - [Install] - WantedBy=multi-user.target -` - -func main() { - flag.Parse() - if *proj == "" { - log.Fatalf("Missing --project flag") - } - prefix := "https://www.googleapis.com/compute/v1/projects/" + *proj - machType := prefix + "/zones/" + *zone + "/machineTypes/" + *mach - - const tokenFileName = "token.dat" - tokenFile := tokenCacheFile(tokenFileName) - tokenSource := oauth2.ReuseTokenSource(nil, tokenFile) - token, err := tokenSource.Token() - if err != nil { - if *writeObject != "" { - log.Fatalf("Can't use --write_object without a valid token.dat file already cached.") - } - log.Printf("Error getting token from %s: %v", tokenFileName, err) - log.Printf("Get auth code from %v", config.AuthCodeURL("my-state")) - fmt.Print("\nEnter auth code: ") - sc := bufio.NewScanner(os.Stdin) - sc.Scan() - authCode := strings.TrimSpace(sc.Text()) - token, err = config.Exchange(oauth2.NoContext, authCode) - if err != nil { - log.Fatalf("Error exchanging auth code for a token: %v", err) - } - if err := tokenFile.WriteToken(token); err != nil { - log.Fatalf("Error writing to %s: %v", tokenFileName, err) - } - tokenSource = oauth2.ReuseTokenSource(token, nil) - } - - oauthClient := oauth2.NewClient(oauth2.NoContext, tokenSource) - - if *writeObject != "" { - writeCloudStorageObject(oauthClient) - return - } - - computeService, _ := compute.New(oauthClient) - - natIP := *staticIP - if natIP == "" { - // Try to find it by name. - aggAddrList, err := computeService.Addresses.AggregatedList(*proj).Do() - if err != nil { - log.Fatal(err) - } - // http://godoc.org/code.google.com/p/google-api-go-client/compute/v1#AddressAggregatedList - IPLoop: - for _, asl := range aggAddrList.Items { - for _, addr := range asl.Addresses { - if addr.Name == *instName+"-ip" && addr.Status == "RESERVED" { - natIP = addr.Address - break IPLoop - } - } - } - } - - cloudConfig := baseConfig - if *sshPub != "" { - key := strings.TrimSpace(readFile(*sshPub)) - cloudConfig += fmt.Sprintf("\nssh_authorized_keys:\n - %s\n", key) - } - if os.Getenv("USER") == "bradfitz" { - cloudConfig += fmt.Sprintf("\nssh_authorized_keys:\n - %s\n", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAwks9dwWKlRC+73gRbvYtVg0vdCwDSuIlyt4z6xa/YU/jTDynM4R4W10hm2tPjy8iR1k8XhDv4/qdxe6m07NjG/By1tkmGpm1mGwho4Pr5kbAAy/Qg+NLCSdAYnnE00FQEcFOC15GFVMOW2AzDGKisReohwH9eIzHPzdYQNPRWXE= bradfitz@papag.bradfitz.com") - } - const maxCloudConfig = 32 << 10 // per compute API docs - if len(cloudConfig) > maxCloudConfig { - log.Fatalf("cloud config length of %d bytes is over %d byte limit", len(cloudConfig), maxCloudConfig) - } - - instance := &compute.Instance{ - Name: *instName, - Description: "Go Builder", - MachineType: machType, - Disks: []*compute.AttachedDisk{instanceDisk(computeService)}, - Tags: &compute.Tags{ - Items: []string{"http-server", "https-server"}, - }, - Metadata: &compute.Metadata{ - Items: []*compute.MetadataItems{ - { - Key: "user-data", - Value: cloudConfig, - }, - }, - }, - NetworkInterfaces: []*compute.NetworkInterface{ - &compute.NetworkInterface{ - AccessConfigs: []*compute.AccessConfig{ - &compute.AccessConfig{ - Type: "ONE_TO_ONE_NAT", - Name: "External NAT", - NatIP: natIP, - }, - }, - Network: prefix + "/global/networks/default", - }, - }, - ServiceAccounts: []*compute.ServiceAccount{ - { - Email: "default", - Scopes: []string{ - compute.DevstorageFull_controlScope, - compute.ComputeScope, - }, - }, - }, - } - - log.Printf("Creating instance...") - op, err := computeService.Instances.Insert(*proj, *zone, instance).Do() - if err != nil { - log.Fatalf("Failed to create instance: %v", err) - } - opName := op.Name - log.Printf("Created. Waiting on operation %v", opName) -OpLoop: - for { - time.Sleep(2 * time.Second) - op, err := computeService.ZoneOperations.Get(*proj, *zone, opName).Do() - if err != nil { - log.Fatalf("Failed to get op %s: %v", opName, err) - } - switch op.Status { - case "PENDING", "RUNNING": - log.Printf("Waiting on operation %v", opName) - continue - case "DONE": - if op.Error != nil { - for _, operr := range op.Error.Errors { - log.Printf("Error: %+v", operr) - } - log.Fatalf("Failed to start.") - } - log.Printf("Success. %+v", op) - break OpLoop - default: - log.Fatalf("Unknown status %q: %+v", op.Status, op) - } - } - - inst, err := computeService.Instances.Get(*proj, *zone, *instName).Do() - if err != nil { - log.Fatalf("Error getting instance after creation: %v", err) - } - ij, _ := json.MarshalIndent(inst, "", " ") - log.Printf("Instance: %s", ij) -} - -func instanceDisk(svc *compute.Service) *compute.AttachedDisk { - const imageURL = "https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-444-5-0-v20141016" - diskName := *instName + "-disk" - - return &compute.AttachedDisk{ - AutoDelete: true, - Boot: true, - Type: "PERSISTENT", - InitializeParams: &compute.AttachedDiskInitializeParams{ - DiskName: diskName, - SourceImage: imageURL, - DiskSizeGb: 50, - }, - } -} - -func writeCloudStorageObject(httpClient *http.Client) { - content := os.Stdin - const maxSlurp = 1 << 20 - var buf bytes.Buffer - n, err := io.CopyN(&buf, content, maxSlurp) - if err != nil && err != io.EOF { - log.Fatalf("Error reading from stdin: %v, %v", n, err) - } - contentType := http.DetectContentType(buf.Bytes()) - - req, err := http.NewRequest("PUT", "https://storage.googleapis.com/"+*writeObject, io.MultiReader(&buf, content)) - if err != nil { - log.Fatal(err) - } - req.Header.Set("x-goog-api-version", "2") - if *publicObject { - req.Header.Set("x-goog-acl", "public-read") - } - req.Header.Set("Content-Type", contentType) - res, err := httpClient.Do(req) - if err != nil { - log.Fatal(err) - } - if res.StatusCode != 200 { - res.Write(os.Stderr) - log.Fatalf("Failed.") - } - log.Printf("Success.") - os.Exit(0) -} - -type tokenCacheFile string - -func (f tokenCacheFile) Token() (*oauth2.Token, error) { - slurp, err := ioutil.ReadFile(string(f)) - if err != nil { - return nil, err - } - t := new(oauth2.Token) - if err := json.Unmarshal(slurp, t); err != nil { - return nil, err - } - return t, nil -} - -func (f tokenCacheFile) WriteToken(t *oauth2.Token) error { - jt, err := json.Marshal(t) - if err != nil { - return err - } - return ioutil.WriteFile(string(f), jt, 0600) -} diff --git a/vendor/golang.org/x/net/http2/h2demo/rootCA.key b/vendor/golang.org/x/net/http2/h2demo/rootCA.key deleted file mode 100644 index a15a6abaf78..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/rootCA.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAt5fAjp4fTcekWUTfzsp0kyih1OYbsGL0KX1eRbSSR8Od0+9Q -62Hyny+GFwMTb4A/KU8mssoHvcceSAAbwfbxFK/+s51TobqUnORZrOoTZjkUygby -XDSK99YBbcR1Pip8vwMTm4XKuLtCigeBBdjjAQdgUO28LENGlsMnmeYkJfODVGnV -mr5Ltb9ANA8IKyTfsnHJ4iOCS/PlPbUj2q7YnoVLposUBMlgUb/CykX3mOoLb4yJ -JQyA/iST6ZxiIEj36D4yWZ5lg7YJl+UiiBQHGCnPdGyipqV06ex0heYWcaiW8LWZ -SUQ93jQ+WVCH8hT7DQO1dmsvUmXlq/JeAlwQ/QIDAQABAoIBAFFHV7JMAqPWnMYA -nezY6J81v9+XN+7xABNWM2Q8uv4WdksbigGLTXR3/680Z2hXqJ7LMeC5XJACFT/e -/Gr0vmpgOCygnCPfjGehGKpavtfksXV3edikUlnCXsOP1C//c1bFL+sMYmFCVgTx -qYdDK8yKzXNGrKYT6q5YG7IglyRNV1rsQa8lM/5taFYiD1Ck/3tQi3YIq8Lcuser -hrxsMABcQ6mi+EIvG6Xr4mfJug0dGJMHG4RG1UGFQn6RXrQq2+q53fC8ZbVUSi0j -NQ918aKFzktwv+DouKU0ME4I9toks03gM860bAL7zCbKGmwR3hfgX/TqzVCWpG9E -LDVfvekCgYEA8fk9N53jbBRmULUGEf4qWypcLGiZnNU0OeXWpbPV9aa3H0VDytA7 -8fCN2dPAVDPqlthMDdVe983NCNwp2Yo8ZimDgowyIAKhdC25s1kejuaiH9OAPj3c -0f8KbriYX4n8zNHxFwK6Ae3pQ6EqOLJVCUsziUaZX9nyKY5aZlyX6xcCgYEAwjws -K62PjC64U5wYddNLp+kNdJ4edx+a7qBb3mEgPvSFT2RO3/xafJyG8kQB30Mfstjd -bRxyUV6N0vtX1zA7VQtRUAvfGCecpMo+VQZzcHXKzoRTnQ7eZg4Lmj5fQ9tOAKAo -QCVBoSW/DI4PZL26CAMDcAba4Pa22ooLapoRIQsCgYA6pIfkkbxLNkpxpt2YwLtt -Kr/590O7UaR9n6k8sW/aQBRDXNsILR1KDl2ifAIxpf9lnXgZJiwE7HiTfCAcW7c1 -nzwDCI0hWuHcMTS/NYsFYPnLsstyyjVZI3FY0h4DkYKV9Q9z3zJLQ2hz/nwoD3gy -b2pHC7giFcTts1VPV4Nt8wKBgHeFn4ihHJweg76vZz3Z78w7VNRWGFklUalVdDK7 -gaQ7w2y/ROn/146mo0OhJaXFIFRlrpvdzVrU3GDf2YXJYDlM5ZRkObwbZADjksev -WInzcgDy3KDg7WnPasRXbTfMU4t/AkW2p1QKbi3DnSVYuokDkbH2Beo45vxDxhKr -C69RAoGBAIyo3+OJenoZmoNzNJl2WPW5MeBUzSh8T/bgyjFTdqFHF5WiYRD/lfHj -x9Glyw2nutuT4hlOqHvKhgTYdDMsF2oQ72fe3v8Q5FU7FuKndNPEAyvKNXZaShVA -hnlhv5DjXKb0wFWnt5PCCiQLtzG0yyHaITrrEme7FikkIcTxaX/Y ------END RSA PRIVATE KEY----- diff --git a/vendor/golang.org/x/net/http2/h2demo/rootCA.pem b/vendor/golang.org/x/net/http2/h2demo/rootCA.pem deleted file mode 100644 index 3a323e774e2..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/rootCA.pem +++ /dev/null @@ -1,26 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEWjCCA0KgAwIBAgIJALfRlWsI8YQHMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNV -BAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEUMBIG -A1UEChMLQnJhZGZpdHppbmMxEjAQBgNVBAMTCWxvY2FsaG9zdDEdMBsGCSqGSIb3 -DQEJARYOYnJhZEBkYW5nYS5jb20wHhcNMTQwNzE1MjA0NjA1WhcNMTcwNTA0MjA0 -NjA1WjB7MQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDVNhbiBG -cmFuY2lzY28xFDASBgNVBAoTC0JyYWRmaXR6aW5jMRIwEAYDVQQDEwlsb2NhbGhv -c3QxHTAbBgkqhkiG9w0BCQEWDmJyYWRAZGFuZ2EuY29tMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAt5fAjp4fTcekWUTfzsp0kyih1OYbsGL0KX1eRbSS -R8Od0+9Q62Hyny+GFwMTb4A/KU8mssoHvcceSAAbwfbxFK/+s51TobqUnORZrOoT -ZjkUygbyXDSK99YBbcR1Pip8vwMTm4XKuLtCigeBBdjjAQdgUO28LENGlsMnmeYk -JfODVGnVmr5Ltb9ANA8IKyTfsnHJ4iOCS/PlPbUj2q7YnoVLposUBMlgUb/CykX3 -mOoLb4yJJQyA/iST6ZxiIEj36D4yWZ5lg7YJl+UiiBQHGCnPdGyipqV06ex0heYW -caiW8LWZSUQ93jQ+WVCH8hT7DQO1dmsvUmXlq/JeAlwQ/QIDAQABo4HgMIHdMB0G -A1UdDgQWBBRcAROthS4P4U7vTfjByC569R7E6DCBrQYDVR0jBIGlMIGigBRcAROt -hS4P4U7vTfjByC569R7E6KF/pH0wezELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNB -MRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRQwEgYDVQQKEwtCcmFkZml0emluYzES -MBAGA1UEAxMJbG9jYWxob3N0MR0wGwYJKoZIhvcNAQkBFg5icmFkQGRhbmdhLmNv -bYIJALfRlWsI8YQHMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAG6h -U9f9sNH0/6oBbGGy2EVU0UgITUQIrFWo9rFkrW5k/XkDjQm+3lzjT0iGR4IxE/Ao -eU6sQhua7wrWeFEn47GL98lnCsJdD7oZNhFmQ95Tb/LnDUjs5Yj9brP0NWzXfYU4 -UK2ZnINJRcJpB8iRCaCxE8DdcUF0XqIEq6pA272snoLmiXLMvNl3kYEdm+je6voD -58SNVEUsztzQyXmJEhCpwVI0A6QCjzXj+qvpmw3ZZHi8JwXei8ZZBLTSFBki8Z7n -sH9BBH38/SzUmAN4QHSPy1gjqm00OAE8NaYDkh/bzE4d7mLGGMWp/WE3KPSu82HF -kPe6XoSbiLm/kxk32T0= ------END CERTIFICATE----- diff --git a/vendor/golang.org/x/net/http2/h2demo/rootCA.srl b/vendor/golang.org/x/net/http2/h2demo/rootCA.srl deleted file mode 100644 index 6db3891880e..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/rootCA.srl +++ /dev/null @@ -1 +0,0 @@ -E2CE26BF3285059C diff --git a/vendor/golang.org/x/net/http2/h2demo/server.crt b/vendor/golang.org/x/net/http2/h2demo/server.crt deleted file mode 100644 index c59059bd640..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/server.crt +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDPjCCAiYCCQDizia/MoUFnDANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJV -UzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xFDASBgNVBAoT -C0JyYWRmaXR6aW5jMRIwEAYDVQQDEwlsb2NhbGhvc3QxHTAbBgkqhkiG9w0BCQEW -DmJyYWRAZGFuZ2EuY29tMB4XDTE0MDcxNTIwNTAyN1oXDTE1MTEyNzIwNTAyN1ow -RzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMQswCQYDVQQHEwJTRjEeMBwGA1UE -ChMVYnJhZGZpdHogaHR0cDIgc2VydmVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAs1Y9CyLFrdL8VQWN1WaifDqaZFnoqjHhCMlc1TfG2zA+InDifx2l -gZD3o8FeNnAcfM2sPlk3+ZleOYw9P/CklFVDlvqmpCv9ss/BEp/dDaWvy1LmJ4c2 -dbQJfmTxn7CV1H3TsVJvKdwFmdoABb41NoBp6+NNO7OtDyhbIMiCI0pL3Nefb3HL -A7hIMo3DYbORTtJLTIH9W8YKrEWL0lwHLrYFx/UdutZnv+HjdmO6vCN4na55mjws -/vjKQUmc7xeY7Xe20xDEG2oDKVkL2eD7FfyrYMS3rO1ExP2KSqlXYG/1S9I/fz88 -F0GK7HX55b5WjZCl2J3ERVdnv/0MQv+sYQIDAQABMA0GCSqGSIb3DQEBBQUAA4IB -AQC0zL+n/YpRZOdulSu9tS8FxrstXqGWoxfe+vIUgqfMZ5+0MkjJ/vW0FqlLDl2R -rn4XaR3e7FmWkwdDVbq/UB6lPmoAaFkCgh9/5oapMaclNVNnfF3fjCJfRr+qj/iD -EmJStTIN0ZuUjAlpiACmfnpEU55PafT5Zx+i1yE4FGjw8bJpFoyD4Hnm54nGjX19 -KeCuvcYFUPnBm3lcL0FalF2AjqV02WTHYNQk7YF/oeO7NKBoEgvGvKG3x+xaOeBI -dwvdq175ZsGul30h+QjrRlXhH/twcuaT3GSdoysDl9cCYE8f1Mk8PD6gan3uBCJU -90p6/CbU71bGbfpM2PHot2fm ------END CERTIFICATE----- diff --git a/vendor/golang.org/x/net/http2/h2demo/server.key b/vendor/golang.org/x/net/http2/h2demo/server.key deleted file mode 100644 index f329c142120..00000000000 --- a/vendor/golang.org/x/net/http2/h2demo/server.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAs1Y9CyLFrdL8VQWN1WaifDqaZFnoqjHhCMlc1TfG2zA+InDi -fx2lgZD3o8FeNnAcfM2sPlk3+ZleOYw9P/CklFVDlvqmpCv9ss/BEp/dDaWvy1Lm -J4c2dbQJfmTxn7CV1H3TsVJvKdwFmdoABb41NoBp6+NNO7OtDyhbIMiCI0pL3Nef -b3HLA7hIMo3DYbORTtJLTIH9W8YKrEWL0lwHLrYFx/UdutZnv+HjdmO6vCN4na55 -mjws/vjKQUmc7xeY7Xe20xDEG2oDKVkL2eD7FfyrYMS3rO1ExP2KSqlXYG/1S9I/ -fz88F0GK7HX55b5WjZCl2J3ERVdnv/0MQv+sYQIDAQABAoIBADQ2spUwbY+bcz4p -3M66ECrNQTBggP40gYl2XyHxGGOu2xhZ94f9ELf1hjRWU2DUKWco1rJcdZClV6q3 -qwmXvcM2Q/SMS8JW0ImkNVl/0/NqPxGatEnj8zY30d/L8hGFb0orzFu/XYA5gCP4 -NbN2WrXgk3ZLeqwcNxHHtSiJWGJ/fPyeDWAu/apy75u9Xf2GlzBZmV6HYD9EfK80 -LTlI60f5FO487CrJnboL7ovPJrIHn+k05xRQqwma4orpz932rTXnTjs9Lg6KtbQN -a7PrqfAntIISgr11a66Mng3IYH1lYqJsWJJwX/xHT4WLEy0EH4/0+PfYemJekz2+ -Co62drECgYEA6O9zVJZXrLSDsIi54cfxA7nEZWm5CAtkYWeAHa4EJ+IlZ7gIf9sL -W8oFcEfFGpvwVqWZ+AsQ70dsjXAv3zXaG0tmg9FtqWp7pzRSMPidifZcQwWkKeTO -gJnFmnVyed8h6GfjTEu4gxo1/S5U0V+mYSha01z5NTnN6ltKx1Or3b0CgYEAxRgm -S30nZxnyg/V7ys61AZhst1DG2tkZXEMcA7dYhabMoXPJAP/EfhlWwpWYYUs/u0gS -Wwmf5IivX5TlYScgmkvb/NYz0u4ZmOXkLTnLPtdKKFXhjXJcHjUP67jYmOxNlJLp -V4vLRnFxTpffAV+OszzRxsXX6fvruwZBANYJeXUCgYBVouLFsFgfWGYp2rpr9XP4 -KK25kvrBqF6JKOIDB1zjxNJ3pUMKrl8oqccCFoCyXa4oTM2kUX0yWxHfleUjrMq4 -yimwQKiOZmV7fVLSSjSw6e/VfBd0h3gb82ygcplZkN0IclkwTY5SNKqwn/3y07V5 -drqdhkrgdJXtmQ6O5YYECQKBgATERcDToQ1USlI4sKrB/wyv1AlG8dg/IebiVJ4e -ZAyvcQmClFzq0qS+FiQUnB/WQw9TeeYrwGs1hxBHuJh16srwhLyDrbMvQP06qh8R -48F8UXXSRec22dV9MQphaROhu2qZdv1AC0WD3tqov6L33aqmEOi+xi8JgbT/PLk5 -c/c1AoGBAI1A/02ryksW6/wc7/6SP2M2rTy4m1sD/GnrTc67EHnRcVBdKO6qH2RY -nqC8YcveC2ZghgPTDsA3VGuzuBXpwY6wTyV99q6jxQJ6/xcrD9/NUG6Uwv/xfCxl -IJLeBYEqQundSSny3VtaAUK8Ul1nxpTvVRNwtcyWTo8RHAAyNPWd ------END RSA PRIVATE KEY----- diff --git a/vendor/golang.org/x/net/http2/h2i/README.md b/vendor/golang.org/x/net/http2/h2i/README.md deleted file mode 100644 index fb5c5efb0f0..00000000000 --- a/vendor/golang.org/x/net/http2/h2i/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# h2i - -**h2i** is an interactive HTTP/2 ("h2") console debugger. Miss the good ol' -days of telnetting to your HTTP/1.n servers? We're bringing you -back. - -Features: -- send raw HTTP/2 frames - - PING - - SETTINGS - - HEADERS - - etc -- type in HTTP/1.n and have it auto-HPACK/frame-ify it for HTTP/2 -- pretty print all received HTTP/2 frames from the peer (including HPACK decoding) -- tab completion of commands, options - -Not yet features, but soon: -- unnecessary CONTINUATION frames on short boundaries, to test peer implementations -- request bodies (DATA frames) -- send invalid frames for testing server implementations (supported by underlying Framer) - -Later: -- act like a server - -## Installation - -``` -$ go get golang.org/x/net/http2/h2i -$ h2i -``` - -## Demo - -``` -$ h2i -Usage: h2i - - -insecure - Whether to skip TLS cert validation - -nextproto string - Comma-separated list of NPN/ALPN protocol names to negotiate. (default "h2,h2-14") - -$ h2i google.com -Connecting to google.com:443 ... -Connected to 74.125.224.41:443 -Negotiated protocol "h2-14" -[FrameHeader SETTINGS len=18] - [MAX_CONCURRENT_STREAMS = 100] - [INITIAL_WINDOW_SIZE = 1048576] - [MAX_FRAME_SIZE = 16384] -[FrameHeader WINDOW_UPDATE len=4] - Window-Increment = 983041 - -h2i> PING h2iSayHI -[FrameHeader PING flags=ACK len=8] - Data = "h2iSayHI" -h2i> headers -(as HTTP/1.1)> GET / HTTP/1.1 -(as HTTP/1.1)> Host: ip.appspot.com -(as HTTP/1.1)> User-Agent: h2i/brad-n-blake -(as HTTP/1.1)> -Opening Stream-ID 1: - :authority = ip.appspot.com - :method = GET - :path = / - :scheme = https - user-agent = h2i/brad-n-blake -[FrameHeader HEADERS flags=END_HEADERS stream=1 len=77] - :status = "200" - alternate-protocol = "443:quic,p=1" - content-length = "15" - content-type = "text/html" - date = "Fri, 01 May 2015 23:06:56 GMT" - server = "Google Frontend" -[FrameHeader DATA flags=END_STREAM stream=1 len=15] - "173.164.155.78\n" -[FrameHeader PING len=8] - Data = "\x00\x00\x00\x00\x00\x00\x00\x00" -h2i> ping -[FrameHeader PING flags=ACK len=8] - Data = "h2i_ping" -h2i> ping -[FrameHeader PING flags=ACK len=8] - Data = "h2i_ping" -h2i> ping -[FrameHeader GOAWAY len=22] - Last-Stream-ID = 1; Error-Code = PROTOCOL_ERROR (1) - -ReadFrame: EOF -``` - -## Status - -Quick few hour hack. So much yet to do. Feel free to file issues for -bugs or wishlist items, but [@bmizerany](https://github.com/bmizerany/) -and I aren't yet accepting pull requests until things settle down. - diff --git a/vendor/golang.org/x/net/http2/h2i/h2i.go b/vendor/golang.org/x/net/http2/h2i/h2i.go deleted file mode 100644 index 73efe86011b..00000000000 --- a/vendor/golang.org/x/net/http2/h2i/h2i.go +++ /dev/null @@ -1,489 +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. -// See https://code.google.com/p/go/source/browse/CONTRIBUTORS -// Licensed under the same terms as Go itself: -// https://code.google.com/p/go/source/browse/LICENSE - -/* -The h2i command is an interactive HTTP/2 console. - -Usage: - $ h2i [flags] - -Interactive commands in the console: (all parts case-insensitive) - - ping [data] - settings ack - settings FOO=n BAR=z - headers (open a new stream by typing HTTP/1.1) -*/ -package main - -import ( - "bufio" - "bytes" - "crypto/tls" - "errors" - "flag" - "fmt" - "io" - "log" - "net" - "net/http" - "os" - "regexp" - "strconv" - "strings" - - "golang.org/x/crypto/ssh/terminal" - "golang.org/x/net/http2" - "golang.org/x/net/http2/hpack" -) - -// Flags -var ( - flagNextProto = flag.String("nextproto", "h2,h2-14", "Comma-separated list of NPN/ALPN protocol names to negotiate.") - flagInsecure = flag.Bool("insecure", false, "Whether to skip TLS cert validation") -) - -type command struct { - run func(*h2i, []string) error // required - - // complete optionally specifies tokens (case-insensitive) which are - // valid for this subcommand. - complete func() []string -} - -var commands = map[string]command{ - "ping": command{run: (*h2i).cmdPing}, - "settings": command{ - run: (*h2i).cmdSettings, - complete: func() []string { - return []string{ - "ACK", - http2.SettingHeaderTableSize.String(), - http2.SettingEnablePush.String(), - http2.SettingMaxConcurrentStreams.String(), - http2.SettingInitialWindowSize.String(), - http2.SettingMaxFrameSize.String(), - http2.SettingMaxHeaderListSize.String(), - } - }, - }, - "quit": command{run: (*h2i).cmdQuit}, - "headers": command{run: (*h2i).cmdHeaders}, -} - -func usage() { - fmt.Fprintf(os.Stderr, "Usage: h2i \n\n") - flag.PrintDefaults() - os.Exit(1) -} - -// withPort adds ":443" if another port isn't already present. -func withPort(host string) string { - if _, _, err := net.SplitHostPort(host); err != nil { - return net.JoinHostPort(host, "443") - } - return host -} - -// h2i is the app's state. -type h2i struct { - host string - tc *tls.Conn - framer *http2.Framer - term *terminal.Terminal - - // owned by the command loop: - streamID uint32 - hbuf bytes.Buffer - henc *hpack.Encoder - - // owned by the readFrames loop: - peerSetting map[http2.SettingID]uint32 - hdec *hpack.Decoder -} - -func main() { - flag.Usage = usage - flag.Parse() - if flag.NArg() != 1 { - usage() - } - log.SetFlags(0) - - host := flag.Arg(0) - app := &h2i{ - host: host, - peerSetting: make(map[http2.SettingID]uint32), - } - app.henc = hpack.NewEncoder(&app.hbuf) - - if err := app.Main(); err != nil { - if app.term != nil { - app.logf("%v\n", err) - } else { - fmt.Fprintf(os.Stderr, "%v\n", err) - } - os.Exit(1) - } - fmt.Fprintf(os.Stdout, "\n") -} - -func (app *h2i) Main() error { - cfg := &tls.Config{ - ServerName: app.host, - NextProtos: strings.Split(*flagNextProto, ","), - InsecureSkipVerify: *flagInsecure, - } - - hostAndPort := withPort(app.host) - log.Printf("Connecting to %s ...", hostAndPort) - tc, err := tls.Dial("tcp", hostAndPort, cfg) - if err != nil { - return fmt.Errorf("Error dialing %s: %v", withPort(app.host), err) - } - log.Printf("Connected to %v", tc.RemoteAddr()) - defer tc.Close() - - if err := tc.Handshake(); err != nil { - return fmt.Errorf("TLS handshake: %v", err) - } - if !*flagInsecure { - if err := tc.VerifyHostname(app.host); err != nil { - return fmt.Errorf("VerifyHostname: %v", err) - } - } - state := tc.ConnectionState() - log.Printf("Negotiated protocol %q", state.NegotiatedProtocol) - if !state.NegotiatedProtocolIsMutual || state.NegotiatedProtocol == "" { - return fmt.Errorf("Could not negotiate protocol mutually") - } - - if _, err := io.WriteString(tc, http2.ClientPreface); err != nil { - return err - } - - app.framer = http2.NewFramer(tc, tc) - - oldState, err := terminal.MakeRaw(0) - if err != nil { - return err - } - defer terminal.Restore(0, oldState) - - var screen = struct { - io.Reader - io.Writer - }{os.Stdin, os.Stdout} - - app.term = terminal.NewTerminal(screen, "h2i> ") - lastWord := regexp.MustCompile(`.+\W(\w+)$`) - app.term.AutoCompleteCallback = func(line string, pos int, key rune) (newLine string, newPos int, ok bool) { - if key != '\t' { - return - } - if pos != len(line) { - // TODO: we're being lazy for now, only supporting tab completion at the end. - return - } - // Auto-complete for the command itself. - if !strings.Contains(line, " ") { - var name string - name, _, ok = lookupCommand(line) - if !ok { - return - } - return name, len(name), true - } - _, c, ok := lookupCommand(line[:strings.IndexByte(line, ' ')]) - if !ok || c.complete == nil { - return - } - if strings.HasSuffix(line, " ") { - app.logf("%s", strings.Join(c.complete(), " ")) - return line, pos, true - } - m := lastWord.FindStringSubmatch(line) - if m == nil { - return line, len(line), true - } - soFar := m[1] - var match []string - for _, cand := range c.complete() { - if len(soFar) > len(cand) || !strings.EqualFold(cand[:len(soFar)], soFar) { - continue - } - match = append(match, cand) - } - if len(match) == 0 { - return - } - if len(match) > 1 { - // TODO: auto-complete any common prefix - app.logf("%s", strings.Join(match, " ")) - return line, pos, true - } - newLine = line[:len(line)-len(soFar)] + match[0] - return newLine, len(newLine), true - - } - - errc := make(chan error, 2) - go func() { errc <- app.readFrames() }() - go func() { errc <- app.readConsole() }() - return <-errc -} - -func (app *h2i) logf(format string, args ...interface{}) { - fmt.Fprintf(app.term, format+"\n", args...) -} - -func (app *h2i) readConsole() error { - for { - line, err := app.term.ReadLine() - if err == io.EOF { - return nil - } - if err != nil { - return fmt.Errorf("terminal.ReadLine: %v", err) - } - f := strings.Fields(line) - if len(f) == 0 { - continue - } - cmd, args := f[0], f[1:] - if _, c, ok := lookupCommand(cmd); ok { - err = c.run(app, args) - } else { - app.logf("Unknown command %q", line) - } - if err == errExitApp { - return nil - } - if err != nil { - return err - } - } -} - -func lookupCommand(prefix string) (name string, c command, ok bool) { - prefix = strings.ToLower(prefix) - if c, ok = commands[prefix]; ok { - return prefix, c, ok - } - - for full, candidate := range commands { - if strings.HasPrefix(full, prefix) { - if c.run != nil { - return "", command{}, false // ambiguous - } - c = candidate - name = full - } - } - return name, c, c.run != nil -} - -var errExitApp = errors.New("internal sentinel error value to quit the console reading loop") - -func (a *h2i) cmdQuit(args []string) error { - if len(args) > 0 { - a.logf("the QUIT command takes no argument") - return nil - } - return errExitApp -} - -func (a *h2i) cmdSettings(args []string) error { - if len(args) == 1 && strings.EqualFold(args[0], "ACK") { - return a.framer.WriteSettingsAck() - } - var settings []http2.Setting - for _, arg := range args { - if strings.EqualFold(arg, "ACK") { - a.logf("Error: ACK must be only argument with the SETTINGS command") - return nil - } - eq := strings.Index(arg, "=") - if eq == -1 { - a.logf("Error: invalid argument %q (expected SETTING_NAME=nnnn)", arg) - return nil - } - sid, ok := settingByName(arg[:eq]) - if !ok { - a.logf("Error: unknown setting name %q", arg[:eq]) - return nil - } - val, err := strconv.ParseUint(arg[eq+1:], 10, 32) - if err != nil { - a.logf("Error: invalid argument %q (expected SETTING_NAME=nnnn)", arg) - return nil - } - settings = append(settings, http2.Setting{ - ID: sid, - Val: uint32(val), - }) - } - a.logf("Sending: %v", settings) - return a.framer.WriteSettings(settings...) -} - -func settingByName(name string) (http2.SettingID, bool) { - for _, sid := range [...]http2.SettingID{ - http2.SettingHeaderTableSize, - http2.SettingEnablePush, - http2.SettingMaxConcurrentStreams, - http2.SettingInitialWindowSize, - http2.SettingMaxFrameSize, - http2.SettingMaxHeaderListSize, - } { - if strings.EqualFold(sid.String(), name) { - return sid, true - } - } - return 0, false -} - -func (app *h2i) cmdPing(args []string) error { - if len(args) > 1 { - app.logf("invalid PING usage: only accepts 0 or 1 args") - return nil // nil means don't end the program - } - var data [8]byte - if len(args) == 1 { - copy(data[:], args[0]) - } else { - copy(data[:], "h2i_ping") - } - return app.framer.WritePing(false, data) -} - -func (app *h2i) cmdHeaders(args []string) error { - if len(args) > 0 { - app.logf("Error: HEADERS doesn't yet take arguments.") - // TODO: flags for restricting window size, to force CONTINUATION - // frames. - return nil - } - var h1req bytes.Buffer - app.term.SetPrompt("(as HTTP/1.1)> ") - defer app.term.SetPrompt("h2i> ") - for { - line, err := app.term.ReadLine() - if err != nil { - return err - } - h1req.WriteString(line) - h1req.WriteString("\r\n") - if line == "" { - break - } - } - req, err := http.ReadRequest(bufio.NewReader(&h1req)) - if err != nil { - app.logf("Invalid HTTP/1.1 request: %v", err) - return nil - } - if app.streamID == 0 { - app.streamID = 1 - } else { - app.streamID += 2 - } - app.logf("Opening Stream-ID %d:", app.streamID) - hbf := app.encodeHeaders(req) - if len(hbf) > 16<<10 { - app.logf("TODO: h2i doesn't yet write CONTINUATION frames. Copy it from transport.go") - return nil - } - return app.framer.WriteHeaders(http2.HeadersFrameParam{ - StreamID: app.streamID, - BlockFragment: hbf, - EndStream: req.Method == "GET" || req.Method == "HEAD", // good enough for now - EndHeaders: true, // for now - }) -} - -func (app *h2i) readFrames() error { - for { - f, err := app.framer.ReadFrame() - if err != nil { - return fmt.Errorf("ReadFrame: %v", err) - } - app.logf("%v", f) - switch f := f.(type) { - case *http2.PingFrame: - app.logf(" Data = %q", f.Data) - case *http2.SettingsFrame: - f.ForeachSetting(func(s http2.Setting) error { - app.logf(" %v", s) - app.peerSetting[s.ID] = s.Val - return nil - }) - case *http2.WindowUpdateFrame: - app.logf(" Window-Increment = %v\n", f.Increment) - case *http2.GoAwayFrame: - app.logf(" Last-Stream-ID = %d; Error-Code = %v (%d)\n", f.LastStreamID, f.ErrCode, f.ErrCode) - case *http2.DataFrame: - app.logf(" %q", f.Data()) - case *http2.HeadersFrame: - if f.HasPriority() { - app.logf(" PRIORITY = %v", f.Priority) - } - if app.hdec == nil { - // TODO: if the user uses h2i to send a SETTINGS frame advertising - // something larger, we'll need to respect SETTINGS_HEADER_TABLE_SIZE - // and stuff here instead of using the 4k default. But for now: - tableSize := uint32(4 << 10) - app.hdec = hpack.NewDecoder(tableSize, app.onNewHeaderField) - } - app.hdec.Write(f.HeaderBlockFragment()) - } - } -} - -// called from readLoop -func (app *h2i) onNewHeaderField(f hpack.HeaderField) { - if f.Sensitive { - app.logf(" %s = %q (SENSITIVE)", f.Name, f.Value) - } - app.logf(" %s = %q", f.Name, f.Value) -} - -func (app *h2i) encodeHeaders(req *http.Request) []byte { - app.hbuf.Reset() - - // TODO(bradfitz): figure out :authority-vs-Host stuff between http2 and Go - host := req.Host - if host == "" { - host = req.URL.Host - } - - path := req.URL.Path - if path == "" { - path = "/" - } - - app.writeHeader(":authority", host) // probably not right for all sites - app.writeHeader(":method", req.Method) - app.writeHeader(":path", path) - app.writeHeader(":scheme", "https") - - for k, vv := range req.Header { - lowKey := strings.ToLower(k) - if lowKey == "host" { - continue - } - for _, v := range vv { - app.writeHeader(lowKey, v) - } - } - return app.hbuf.Bytes() -} - -func (app *h2i) writeHeader(name, value string) { - app.henc.WriteField(hpack.HeaderField{Name: name, Value: value}) - app.logf(" %s = %s", name, value) -} 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 452fb8c1246..00000000000 --- a/vendor/golang.org/x/oauth2/clientcredentials/clientcredentials.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2014 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 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 retreive 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 9c816ff8058..00000000000 --- a/vendor/golang.org/x/oauth2/facebook/facebook.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 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 82ca623dd12..00000000000 --- a/vendor/golang.org/x/oauth2/github/github.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 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 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 d93fded6ad5..00000000000 --- a/vendor/golang.org/x/oauth2/linkedin/linkedin.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 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/odnoklassniki/odnoklassniki.go b/vendor/golang.org/x/oauth2/odnoklassniki/odnoklassniki.go deleted file mode 100644 index f0b66f97def..00000000000 --- a/vendor/golang.org/x/oauth2/odnoklassniki/odnoklassniki.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 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 a99366b6e24..00000000000 --- a/vendor/golang.org/x/oauth2/paypal/paypal.go +++ /dev/null @@ -1,22 +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 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 00e929357a2..00000000000 --- a/vendor/golang.org/x/oauth2/vk/vk.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 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/google.golang.org/api/googleapi/transport/apikey.go b/vendor/google.golang.org/api/googleapi/transport/apikey.go deleted file mode 100644 index eca1ea25077..00000000000 --- 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/cloud/internal/datastore/datastore_v1.pb.go b/vendor/google.golang.org/cloud/internal/datastore/datastore_v1.pb.go deleted file mode 100644 index 9cb9be528cc..00000000000 --- 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 d752beaa5ed..00000000000 --- 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 844d310447d..00000000000 --- 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 34e6058981e..00000000000 --- a/vendor/google.golang.org/cloud/internal/testutil/context.go +++ /dev/null @@ -1,60 +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" -) - -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) -} 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 ddae71ccef4..00000000000 --- 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 c11a4ddebcc..00000000000 --- 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 ae2baf9fd2c..00000000000 --- 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 05b11cde1ea..00000000000 --- 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 - } -} diff --git a/vendor/google.golang.org/grpc/Documentation/grpc-auth-support.md b/vendor/google.golang.org/grpc/Documentation/grpc-auth-support.md deleted file mode 100644 index 5a075f61320..00000000000 --- a/vendor/google.golang.org/grpc/Documentation/grpc-auth-support.md +++ /dev/null @@ -1,41 +0,0 @@ -# Authentication - -As outlined in the [gRPC authentication guide](http://www.grpc.io/docs/guides/auth.html) there are a number of different mechanisms for asserting identity between an client and server. We'll present some code-samples here demonstrating how to provide TLS support encryption and identity assertions as well as passing OAuth2 tokens to services that support it. - -# Enabling TLS on a gRPC client - -```Go -conn, err := grpc.Dial(serverAddr, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")) -``` - -# Enabling TLS on a gRPC server - -```Go -creds, err := credentials.NewServerTLSFromFile(certFile, keyFile) -if err != nil { - log.Fatalf("Failed to generate credentials %v", err) -} -lis, err := net.Listen("tcp", ":0") -server := grpc.NewServer(grpc.Creds(creds)) -... -server.Serve(lis) -``` - -# Authenticating with Google - -## Google Compute Engine (GCE) - -```Go -conn, err := grpc.Dial(serverAddr, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, ""), grpc.WithPerRPCCredentials(oauth.NewComputeEngine()))) -``` - -## JWT - -```Go -jwtCreds, err := oauth.NewServiceAccountFromFile(*serviceAccountKeyFile, *oauthScope) -if err != nil { - log.Fatalf("Failed to create JWT credentials: %v", err) -} -conn, err := grpc.Dial(serverAddr, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, ""), grpc.WithPerRPCCredentials(jwtCreds))) -``` - diff --git a/vendor/google.golang.org/grpc/benchmark/benchmark.go b/vendor/google.golang.org/grpc/benchmark/benchmark.go deleted file mode 100644 index 7215d35a51c..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/benchmark.go +++ /dev/null @@ -1,147 +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. - * - */ - -/* -Package benchmark implements the building blocks to setup end-to-end gRPC benchmarks. -*/ -package benchmark - -import ( - "io" - "math" - "net" - - "golang.org/x/net/context" - "google.golang.org/grpc" - testpb "google.golang.org/grpc/benchmark/grpc_testing" - "google.golang.org/grpc/grpclog" -) - -func newPayload(t testpb.PayloadType, size int) *testpb.Payload { - if size < 0 { - grpclog.Fatalf("Requested a response with invalid length %d", size) - } - body := make([]byte, size) - switch t { - case testpb.PayloadType_COMPRESSABLE: - case testpb.PayloadType_UNCOMPRESSABLE: - grpclog.Fatalf("PayloadType UNCOMPRESSABLE is not supported") - default: - grpclog.Fatalf("Unsupported payload type: %d", t) - } - return &testpb.Payload{ - Type: t, - Body: body, - } -} - -type testServer struct { -} - -func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { - return &testpb.SimpleResponse{ - Payload: newPayload(in.ResponseType, int(in.ResponseSize)), - }, nil -} - -func (s *testServer) StreamingCall(stream testpb.TestService_StreamingCallServer) error { - for { - in, err := stream.Recv() - if err == io.EOF { - // read done. - return nil - } - if err != nil { - return err - } - if err := stream.Send(&testpb.SimpleResponse{ - Payload: newPayload(in.ResponseType, int(in.ResponseSize)), - }); err != nil { - return err - } - } -} - -// StartServer starts a gRPC server serving a benchmark service on the given -// address, which may be something like "localhost:0". It returns its listen -// address and a function to stop the server. -func StartServer(addr string) (string, func()) { - lis, err := net.Listen("tcp", addr) - if err != nil { - grpclog.Fatalf("Failed to listen: %v", err) - } - s := grpc.NewServer(grpc.MaxConcurrentStreams(math.MaxUint32)) - testpb.RegisterTestServiceServer(s, &testServer{}) - go s.Serve(lis) - return lis.Addr().String(), func() { - s.Stop() - } -} - -// DoUnaryCall performs an unary RPC with given stub and request and response sizes. -func DoUnaryCall(tc testpb.TestServiceClient, reqSize, respSize int) { - pl := newPayload(testpb.PayloadType_COMPRESSABLE, reqSize) - req := &testpb.SimpleRequest{ - ResponseType: pl.Type, - ResponseSize: int32(respSize), - Payload: pl, - } - if _, err := tc.UnaryCall(context.Background(), req); err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } -} - -// DoStreamingRoundTrip performs a round trip for a single streaming rpc. -func DoStreamingRoundTrip(tc testpb.TestServiceClient, stream testpb.TestService_StreamingCallClient, reqSize, respSize int) { - pl := newPayload(testpb.PayloadType_COMPRESSABLE, reqSize) - req := &testpb.SimpleRequest{ - ResponseType: pl.Type, - ResponseSize: int32(respSize), - Payload: pl, - } - if err := stream.Send(req); err != nil { - grpclog.Fatalf("StreamingCall(_).Send: %v", err) - } - if _, err := stream.Recv(); err != nil { - grpclog.Fatalf("StreamingCall(_).Recv: %v", err) - } -} - -// NewClientConn creates a gRPC client connection to addr. -func NewClientConn(addr string) *grpc.ClientConn { - conn, err := grpc.Dial(addr, grpc.WithInsecure()) - if err != nil { - grpclog.Fatalf("NewClientConn(%q) failed to create a ClientConn %v", addr, err) - } - return conn -} diff --git a/vendor/google.golang.org/grpc/benchmark/client/main.go b/vendor/google.golang.org/grpc/benchmark/client/main.go deleted file mode 100644 index e7f0a8fb2c9..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/client/main.go +++ /dev/null @@ -1,162 +0,0 @@ -package main - -import ( - "flag" - "math" - "net" - "net/http" - _ "net/http/pprof" - "sync" - "time" - - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/benchmark" - testpb "google.golang.org/grpc/benchmark/grpc_testing" - "google.golang.org/grpc/benchmark/stats" - "google.golang.org/grpc/grpclog" -) - -var ( - server = flag.String("server", "", "The server address") - maxConcurrentRPCs = flag.Int("max_concurrent_rpcs", 1, "The max number of concurrent RPCs") - duration = flag.Int("duration", math.MaxInt32, "The duration in seconds to run the benchmark client") - trace = flag.Bool("trace", true, "Whether tracing is on") - rpcType = flag.Int("rpc_type", 0, - `Configure different client rpc type. Valid options are: - 0 : unary call; - 1 : streaming call.`) -) - -func unaryCaller(client testpb.TestServiceClient) { - benchmark.DoUnaryCall(client, 1, 1) -} - -func streamCaller(client testpb.TestServiceClient, stream testpb.TestService_StreamingCallClient) { - benchmark.DoStreamingRoundTrip(client, stream, 1, 1) -} - -func buildConnection() (s *stats.Stats, conn *grpc.ClientConn, tc testpb.TestServiceClient) { - s = stats.NewStats(256) - conn = benchmark.NewClientConn(*server) - tc = testpb.NewTestServiceClient(conn) - return s, conn, tc -} - -func closeLoopUnary() { - s, conn, tc := buildConnection() - - for i := 0; i < 100; i++ { - unaryCaller(tc) - } - ch := make(chan int, *maxConcurrentRPCs*4) - var ( - mu sync.Mutex - wg sync.WaitGroup - ) - wg.Add(*maxConcurrentRPCs) - - for i := 0; i < *maxConcurrentRPCs; i++ { - go func() { - for _ = range ch { - start := time.Now() - unaryCaller(tc) - elapse := time.Since(start) - mu.Lock() - s.Add(elapse) - mu.Unlock() - } - wg.Done() - }() - } - // Stop the client when time is up. - done := make(chan struct{}) - go func() { - <-time.After(time.Duration(*duration) * time.Second) - close(done) - }() - ok := true - for ok { - select { - case ch <- 0: - case <-done: - ok = false - } - } - close(ch) - wg.Wait() - conn.Close() - grpclog.Println(s.String()) - -} - -func closeLoopStream() { - s, conn, tc := buildConnection() - ch := make(chan int, *maxConcurrentRPCs*4) - var ( - mu sync.Mutex - wg sync.WaitGroup - ) - wg.Add(*maxConcurrentRPCs) - // Distribute RPCs over maxConcurrentCalls workers. - for i := 0; i < *maxConcurrentRPCs; i++ { - go func() { - stream, err := tc.StreamingCall(context.Background()) - if err != nil { - grpclog.Fatalf("%v.StreamingCall(_) = _, %v", tc, err) - } - // Do some warm up. - for i := 0; i < 100; i++ { - streamCaller(tc, stream) - } - for range ch { - start := time.Now() - streamCaller(tc, stream) - elapse := time.Since(start) - mu.Lock() - s.Add(elapse) - mu.Unlock() - } - wg.Done() - }() - } - // Stop the client when time is up. - done := make(chan struct{}) - go func() { - <-time.After(time.Duration(*duration) * time.Second) - close(done) - }() - ok := true - for ok { - select { - case ch <- 0: - case <-done: - ok = false - } - } - close(ch) - wg.Wait() - conn.Close() - grpclog.Println(s.String()) -} - -func main() { - flag.Parse() - grpc.EnableTracing = *trace - go func() { - lis, err := net.Listen("tcp", ":0") - if err != nil { - grpclog.Fatalf("Failed to listen: %v", err) - } - grpclog.Println("Client profiling address: ", lis.Addr().String()) - if err := http.Serve(lis, nil); err != nil { - grpclog.Fatalf("Failed to serve: %v", err) - } - }() - switch *rpcType { - case 0: - closeLoopUnary() - case 1: - closeLoopStream() - } -} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/test.pb.go b/vendor/google.golang.org/grpc/benchmark/grpc_testing/test.pb.go deleted file mode 100644 index c080709e132..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/grpc_testing/test.pb.go +++ /dev/null @@ -1,941 +0,0 @@ -// Code generated by protoc-gen-go. -// source: test.proto -// DO NOT EDIT! - -/* -Package grpc_testing is a generated protocol buffer package. - -It is generated from these files: - test.proto - -It has these top-level messages: - StatsRequest - ServerStats - Payload - HistogramData - ClientConfig - Mark - ClientArgs - ClientStats - ClientStatus - ServerConfig - ServerArgs - ServerStatus - SimpleRequest - SimpleResponse -*/ -package grpc_testing - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -type PayloadType int32 - -const ( - // Compressable text format. - PayloadType_COMPRESSABLE PayloadType = 0 - // Uncompressable binary format. - PayloadType_UNCOMPRESSABLE PayloadType = 1 - // Randomly chosen from all other formats defined in this enum. - PayloadType_RANDOM PayloadType = 2 -) - -var PayloadType_name = map[int32]string{ - 0: "COMPRESSABLE", - 1: "UNCOMPRESSABLE", - 2: "RANDOM", -} -var PayloadType_value = map[string]int32{ - "COMPRESSABLE": 0, - "UNCOMPRESSABLE": 1, - "RANDOM": 2, -} - -func (x PayloadType) String() string { - return proto.EnumName(PayloadType_name, int32(x)) -} -func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -type ClientType int32 - -const ( - ClientType_SYNCHRONOUS_CLIENT ClientType = 0 - ClientType_ASYNC_CLIENT ClientType = 1 -) - -var ClientType_name = map[int32]string{ - 0: "SYNCHRONOUS_CLIENT", - 1: "ASYNC_CLIENT", -} -var ClientType_value = map[string]int32{ - "SYNCHRONOUS_CLIENT": 0, - "ASYNC_CLIENT": 1, -} - -func (x ClientType) String() string { - return proto.EnumName(ClientType_name, int32(x)) -} -func (ClientType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -type ServerType int32 - -const ( - ServerType_SYNCHRONOUS_SERVER ServerType = 0 - ServerType_ASYNC_SERVER ServerType = 1 -) - -var ServerType_name = map[int32]string{ - 0: "SYNCHRONOUS_SERVER", - 1: "ASYNC_SERVER", -} -var ServerType_value = map[string]int32{ - "SYNCHRONOUS_SERVER": 0, - "ASYNC_SERVER": 1, -} - -func (x ServerType) String() string { - return proto.EnumName(ServerType_name, int32(x)) -} -func (ServerType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -type RpcType int32 - -const ( - RpcType_UNARY RpcType = 0 - RpcType_STREAMING RpcType = 1 -) - -var RpcType_name = map[int32]string{ - 0: "UNARY", - 1: "STREAMING", -} -var RpcType_value = map[string]int32{ - "UNARY": 0, - "STREAMING": 1, -} - -func (x RpcType) String() string { - return proto.EnumName(RpcType_name, int32(x)) -} -func (RpcType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -type StatsRequest struct { - // run number - TestNum int32 `protobuf:"varint,1,opt,name=test_num" json:"test_num,omitempty"` -} - -func (m *StatsRequest) Reset() { *m = StatsRequest{} } -func (m *StatsRequest) String() string { return proto.CompactTextString(m) } -func (*StatsRequest) ProtoMessage() {} -func (*StatsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -type ServerStats struct { - // wall clock time - TimeElapsed float64 `protobuf:"fixed64,1,opt,name=time_elapsed" json:"time_elapsed,omitempty"` - // user time used by the server process and threads - TimeUser float64 `protobuf:"fixed64,2,opt,name=time_user" json:"time_user,omitempty"` - // server time used by the server process and all threads - TimeSystem float64 `protobuf:"fixed64,3,opt,name=time_system" json:"time_system,omitempty"` -} - -func (m *ServerStats) Reset() { *m = ServerStats{} } -func (m *ServerStats) String() string { return proto.CompactTextString(m) } -func (*ServerStats) ProtoMessage() {} -func (*ServerStats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -type Payload struct { - // The type of data in body. - Type PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"` - // Primary contents of payload. - Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` -} - -func (m *Payload) Reset() { *m = Payload{} } -func (m *Payload) String() string { return proto.CompactTextString(m) } -func (*Payload) ProtoMessage() {} -func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -type HistogramData struct { - Bucket []uint32 `protobuf:"varint,1,rep,name=bucket" json:"bucket,omitempty"` - MinSeen float64 `protobuf:"fixed64,2,opt,name=min_seen" json:"min_seen,omitempty"` - MaxSeen float64 `protobuf:"fixed64,3,opt,name=max_seen" json:"max_seen,omitempty"` - Sum float64 `protobuf:"fixed64,4,opt,name=sum" json:"sum,omitempty"` - SumOfSquares float64 `protobuf:"fixed64,5,opt,name=sum_of_squares" json:"sum_of_squares,omitempty"` - Count float64 `protobuf:"fixed64,6,opt,name=count" json:"count,omitempty"` -} - -func (m *HistogramData) Reset() { *m = HistogramData{} } -func (m *HistogramData) String() string { return proto.CompactTextString(m) } -func (*HistogramData) ProtoMessage() {} -func (*HistogramData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -type ClientConfig struct { - ServerTargets []string `protobuf:"bytes,1,rep,name=server_targets" json:"server_targets,omitempty"` - ClientType ClientType `protobuf:"varint,2,opt,name=client_type,enum=grpc.testing.ClientType" json:"client_type,omitempty"` - EnableSsl bool `protobuf:"varint,3,opt,name=enable_ssl" json:"enable_ssl,omitempty"` - OutstandingRpcsPerChannel int32 `protobuf:"varint,4,opt,name=outstanding_rpcs_per_channel" json:"outstanding_rpcs_per_channel,omitempty"` - ClientChannels int32 `protobuf:"varint,5,opt,name=client_channels" json:"client_channels,omitempty"` - PayloadSize int32 `protobuf:"varint,6,opt,name=payload_size" json:"payload_size,omitempty"` - // only for async client: - AsyncClientThreads int32 `protobuf:"varint,7,opt,name=async_client_threads" json:"async_client_threads,omitempty"` - RpcType RpcType `protobuf:"varint,8,opt,name=rpc_type,enum=grpc.testing.RpcType" json:"rpc_type,omitempty"` -} - -func (m *ClientConfig) Reset() { *m = ClientConfig{} } -func (m *ClientConfig) String() string { return proto.CompactTextString(m) } -func (*ClientConfig) ProtoMessage() {} -func (*ClientConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -// Request current stats -type Mark struct { -} - -func (m *Mark) Reset() { *m = Mark{} } -func (m *Mark) String() string { return proto.CompactTextString(m) } -func (*Mark) ProtoMessage() {} -func (*Mark) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - -type ClientArgs struct { - // Types that are valid to be assigned to Argtype: - // *ClientArgs_Setup - // *ClientArgs_Mark - Argtype isClientArgs_Argtype `protobuf_oneof:"argtype"` -} - -func (m *ClientArgs) Reset() { *m = ClientArgs{} } -func (m *ClientArgs) String() string { return proto.CompactTextString(m) } -func (*ClientArgs) ProtoMessage() {} -func (*ClientArgs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } - -type isClientArgs_Argtype interface { - isClientArgs_Argtype() -} - -type ClientArgs_Setup struct { - Setup *ClientConfig `protobuf:"bytes,1,opt,name=setup,oneof"` -} -type ClientArgs_Mark struct { - Mark *Mark `protobuf:"bytes,2,opt,name=mark,oneof"` -} - -func (*ClientArgs_Setup) isClientArgs_Argtype() {} -func (*ClientArgs_Mark) isClientArgs_Argtype() {} - -func (m *ClientArgs) GetArgtype() isClientArgs_Argtype { - if m != nil { - return m.Argtype - } - return nil -} - -func (m *ClientArgs) GetSetup() *ClientConfig { - if x, ok := m.GetArgtype().(*ClientArgs_Setup); ok { - return x.Setup - } - return nil -} - -func (m *ClientArgs) GetMark() *Mark { - if x, ok := m.GetArgtype().(*ClientArgs_Mark); ok { - return x.Mark - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ClientArgs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _ClientArgs_OneofMarshaler, _ClientArgs_OneofUnmarshaler, _ClientArgs_OneofSizer, []interface{}{ - (*ClientArgs_Setup)(nil), - (*ClientArgs_Mark)(nil), - } -} - -func _ClientArgs_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ClientArgs) - // argtype - switch x := m.Argtype.(type) { - case *ClientArgs_Setup: - b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Setup); err != nil { - return err - } - case *ClientArgs_Mark: - b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Mark); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ClientArgs.Argtype has unexpected type %T", x) - } - return nil -} - -func _ClientArgs_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ClientArgs) - switch tag { - case 1: // argtype.setup - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ClientConfig) - err := b.DecodeMessage(msg) - m.Argtype = &ClientArgs_Setup{msg} - return true, err - case 2: // argtype.mark - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Mark) - err := b.DecodeMessage(msg) - m.Argtype = &ClientArgs_Mark{msg} - return true, err - default: - return false, nil - } -} - -func _ClientArgs_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ClientArgs) - // argtype - switch x := m.Argtype.(type) { - case *ClientArgs_Setup: - s := proto.Size(x.Setup) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *ClientArgs_Mark: - s := proto.Size(x.Mark) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type ClientStats struct { - Latencies *HistogramData `protobuf:"bytes,1,opt,name=latencies" json:"latencies,omitempty"` - TimeElapsed float64 `protobuf:"fixed64,3,opt,name=time_elapsed" json:"time_elapsed,omitempty"` - TimeUser float64 `protobuf:"fixed64,4,opt,name=time_user" json:"time_user,omitempty"` - TimeSystem float64 `protobuf:"fixed64,5,opt,name=time_system" json:"time_system,omitempty"` -} - -func (m *ClientStats) Reset() { *m = ClientStats{} } -func (m *ClientStats) String() string { return proto.CompactTextString(m) } -func (*ClientStats) ProtoMessage() {} -func (*ClientStats) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } - -func (m *ClientStats) GetLatencies() *HistogramData { - if m != nil { - return m.Latencies - } - return nil -} - -type ClientStatus struct { - Stats *ClientStats `protobuf:"bytes,1,opt,name=stats" json:"stats,omitempty"` -} - -func (m *ClientStatus) Reset() { *m = ClientStatus{} } -func (m *ClientStatus) String() string { return proto.CompactTextString(m) } -func (*ClientStatus) ProtoMessage() {} -func (*ClientStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } - -func (m *ClientStatus) GetStats() *ClientStats { - if m != nil { - return m.Stats - } - return nil -} - -type ServerConfig struct { - ServerType ServerType `protobuf:"varint,1,opt,name=server_type,enum=grpc.testing.ServerType" json:"server_type,omitempty"` - Threads int32 `protobuf:"varint,2,opt,name=threads" json:"threads,omitempty"` - EnableSsl bool `protobuf:"varint,3,opt,name=enable_ssl" json:"enable_ssl,omitempty"` -} - -func (m *ServerConfig) Reset() { *m = ServerConfig{} } -func (m *ServerConfig) String() string { return proto.CompactTextString(m) } -func (*ServerConfig) ProtoMessage() {} -func (*ServerConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } - -type ServerArgs struct { - // Types that are valid to be assigned to Argtype: - // *ServerArgs_Setup - // *ServerArgs_Mark - Argtype isServerArgs_Argtype `protobuf_oneof:"argtype"` -} - -func (m *ServerArgs) Reset() { *m = ServerArgs{} } -func (m *ServerArgs) String() string { return proto.CompactTextString(m) } -func (*ServerArgs) ProtoMessage() {} -func (*ServerArgs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } - -type isServerArgs_Argtype interface { - isServerArgs_Argtype() -} - -type ServerArgs_Setup struct { - Setup *ServerConfig `protobuf:"bytes,1,opt,name=setup,oneof"` -} -type ServerArgs_Mark struct { - Mark *Mark `protobuf:"bytes,2,opt,name=mark,oneof"` -} - -func (*ServerArgs_Setup) isServerArgs_Argtype() {} -func (*ServerArgs_Mark) isServerArgs_Argtype() {} - -func (m *ServerArgs) GetArgtype() isServerArgs_Argtype { - if m != nil { - return m.Argtype - } - return nil -} - -func (m *ServerArgs) GetSetup() *ServerConfig { - if x, ok := m.GetArgtype().(*ServerArgs_Setup); ok { - return x.Setup - } - return nil -} - -func (m *ServerArgs) GetMark() *Mark { - if x, ok := m.GetArgtype().(*ServerArgs_Mark); ok { - return x.Mark - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ServerArgs) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _ServerArgs_OneofMarshaler, _ServerArgs_OneofUnmarshaler, _ServerArgs_OneofSizer, []interface{}{ - (*ServerArgs_Setup)(nil), - (*ServerArgs_Mark)(nil), - } -} - -func _ServerArgs_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ServerArgs) - // argtype - switch x := m.Argtype.(type) { - case *ServerArgs_Setup: - b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Setup); err != nil { - return err - } - case *ServerArgs_Mark: - b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Mark); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ServerArgs.Argtype has unexpected type %T", x) - } - return nil -} - -func _ServerArgs_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ServerArgs) - switch tag { - case 1: // argtype.setup - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ServerConfig) - err := b.DecodeMessage(msg) - m.Argtype = &ServerArgs_Setup{msg} - return true, err - case 2: // argtype.mark - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(Mark) - err := b.DecodeMessage(msg) - m.Argtype = &ServerArgs_Mark{msg} - return true, err - default: - return false, nil - } -} - -func _ServerArgs_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ServerArgs) - // argtype - switch x := m.Argtype.(type) { - case *ServerArgs_Setup: - s := proto.Size(x.Setup) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *ServerArgs_Mark: - s := proto.Size(x.Mark) - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -type ServerStatus struct { - Stats *ServerStats `protobuf:"bytes,1,opt,name=stats" json:"stats,omitempty"` - Port int32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"` -} - -func (m *ServerStatus) Reset() { *m = ServerStatus{} } -func (m *ServerStatus) String() string { return proto.CompactTextString(m) } -func (*ServerStatus) ProtoMessage() {} -func (*ServerStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } - -func (m *ServerStatus) GetStats() *ServerStats { - if m != nil { - return m.Stats - } - return nil -} - -type SimpleRequest struct { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - ResponseSize int32 `protobuf:"varint,2,opt,name=response_size" json:"response_size,omitempty"` - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` -} - -func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } -func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } -func (*SimpleRequest) ProtoMessage() {} -func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } - -func (m *SimpleRequest) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -type SimpleResponse struct { - Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` -} - -func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } -func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } -func (*SimpleResponse) ProtoMessage() {} -func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } - -func (m *SimpleResponse) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -func init() { - proto.RegisterType((*StatsRequest)(nil), "grpc.testing.StatsRequest") - proto.RegisterType((*ServerStats)(nil), "grpc.testing.ServerStats") - proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") - proto.RegisterType((*HistogramData)(nil), "grpc.testing.HistogramData") - proto.RegisterType((*ClientConfig)(nil), "grpc.testing.ClientConfig") - proto.RegisterType((*Mark)(nil), "grpc.testing.Mark") - proto.RegisterType((*ClientArgs)(nil), "grpc.testing.ClientArgs") - proto.RegisterType((*ClientStats)(nil), "grpc.testing.ClientStats") - proto.RegisterType((*ClientStatus)(nil), "grpc.testing.ClientStatus") - proto.RegisterType((*ServerConfig)(nil), "grpc.testing.ServerConfig") - proto.RegisterType((*ServerArgs)(nil), "grpc.testing.ServerArgs") - proto.RegisterType((*ServerStatus)(nil), "grpc.testing.ServerStatus") - proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") - proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") - proto.RegisterEnum("grpc.testing.PayloadType", PayloadType_name, PayloadType_value) - proto.RegisterEnum("grpc.testing.ClientType", ClientType_name, ClientType_value) - proto.RegisterEnum("grpc.testing.ServerType", ServerType_name, ServerType_value) - proto.RegisterEnum("grpc.testing.RpcType", RpcType_name, RpcType_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// Client API for TestService service - -type TestServiceClient interface { - // One request followed by one response. - // The server returns the client payload as-is. - UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) - // One request followed by one response. - // The server returns the client payload as-is. - StreamingCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingCallClient, error) -} - -type testServiceClient struct { - cc *grpc.ClientConn -} - -func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient { - return &testServiceClient{cc} -} - -func (c *testServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { - out := new(SimpleResponse) - err := grpc.Invoke(ctx, "/grpc.testing.TestService/UnaryCall", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testServiceClient) StreamingCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingCallClient, error) { - stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/grpc.testing.TestService/StreamingCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceStreamingCallClient{stream} - return x, nil -} - -type TestService_StreamingCallClient interface { - Send(*SimpleRequest) error - Recv() (*SimpleResponse, error) - grpc.ClientStream -} - -type testServiceStreamingCallClient struct { - grpc.ClientStream -} - -func (x *testServiceStreamingCallClient) Send(m *SimpleRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testServiceStreamingCallClient) Recv() (*SimpleResponse, error) { - m := new(SimpleResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Server API for TestService service - -type TestServiceServer interface { - // One request followed by one response. - // The server returns the client payload as-is. - UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) - // One request followed by one response. - // The server returns the client payload as-is. - StreamingCall(TestService_StreamingCallServer) error -} - -func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { - s.RegisterService(&_TestService_serviceDesc, srv) -} - -func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { - in := new(SimpleRequest) - if err := dec(in); err != nil { - return nil, err - } - out, err := srv.(TestServiceServer).UnaryCall(ctx, in) - if err != nil { - return nil, err - } - return out, nil -} - -func _TestService_StreamingCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServiceServer).StreamingCall(&testServiceStreamingCallServer{stream}) -} - -type TestService_StreamingCallServer interface { - Send(*SimpleResponse) error - Recv() (*SimpleRequest, error) - grpc.ServerStream -} - -type testServiceStreamingCallServer struct { - grpc.ServerStream -} - -func (x *testServiceStreamingCallServer) Send(m *SimpleResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testServiceStreamingCallServer) Recv() (*SimpleRequest, error) { - m := new(SimpleRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _TestService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.testing.TestService", - HandlerType: (*TestServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UnaryCall", - Handler: _TestService_UnaryCall_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamingCall", - Handler: _TestService_StreamingCall_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, -} - -// Client API for Worker service - -type WorkerClient interface { - // Start test with specified workload - RunTest(ctx context.Context, opts ...grpc.CallOption) (Worker_RunTestClient, error) - // Start test with specified workload - RunServer(ctx context.Context, opts ...grpc.CallOption) (Worker_RunServerClient, error) -} - -type workerClient struct { - cc *grpc.ClientConn -} - -func NewWorkerClient(cc *grpc.ClientConn) WorkerClient { - return &workerClient{cc} -} - -func (c *workerClient) RunTest(ctx context.Context, opts ...grpc.CallOption) (Worker_RunTestClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Worker_serviceDesc.Streams[0], c.cc, "/grpc.testing.Worker/RunTest", opts...) - if err != nil { - return nil, err - } - x := &workerRunTestClient{stream} - return x, nil -} - -type Worker_RunTestClient interface { - Send(*ClientArgs) error - Recv() (*ClientStatus, error) - grpc.ClientStream -} - -type workerRunTestClient struct { - grpc.ClientStream -} - -func (x *workerRunTestClient) Send(m *ClientArgs) error { - return x.ClientStream.SendMsg(m) -} - -func (x *workerRunTestClient) Recv() (*ClientStatus, error) { - m := new(ClientStatus) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *workerClient) RunServer(ctx context.Context, opts ...grpc.CallOption) (Worker_RunServerClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Worker_serviceDesc.Streams[1], c.cc, "/grpc.testing.Worker/RunServer", opts...) - if err != nil { - return nil, err - } - x := &workerRunServerClient{stream} - return x, nil -} - -type Worker_RunServerClient interface { - Send(*ServerArgs) error - Recv() (*ServerStatus, error) - grpc.ClientStream -} - -type workerRunServerClient struct { - grpc.ClientStream -} - -func (x *workerRunServerClient) Send(m *ServerArgs) error { - return x.ClientStream.SendMsg(m) -} - -func (x *workerRunServerClient) Recv() (*ServerStatus, error) { - m := new(ServerStatus) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Server API for Worker service - -type WorkerServer interface { - // Start test with specified workload - RunTest(Worker_RunTestServer) error - // Start test with specified workload - RunServer(Worker_RunServerServer) error -} - -func RegisterWorkerServer(s *grpc.Server, srv WorkerServer) { - s.RegisterService(&_Worker_serviceDesc, srv) -} - -func _Worker_RunTest_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(WorkerServer).RunTest(&workerRunTestServer{stream}) -} - -type Worker_RunTestServer interface { - Send(*ClientStatus) error - Recv() (*ClientArgs, error) - grpc.ServerStream -} - -type workerRunTestServer struct { - grpc.ServerStream -} - -func (x *workerRunTestServer) Send(m *ClientStatus) error { - return x.ServerStream.SendMsg(m) -} - -func (x *workerRunTestServer) Recv() (*ClientArgs, error) { - m := new(ClientArgs) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Worker_RunServer_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(WorkerServer).RunServer(&workerRunServerServer{stream}) -} - -type Worker_RunServerServer interface { - Send(*ServerStatus) error - Recv() (*ServerArgs, error) - grpc.ServerStream -} - -type workerRunServerServer struct { - grpc.ServerStream -} - -func (x *workerRunServerServer) Send(m *ServerStatus) error { - return x.ServerStream.SendMsg(m) -} - -func (x *workerRunServerServer) Recv() (*ServerArgs, error) { - m := new(ServerArgs) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _Worker_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.testing.Worker", - HandlerType: (*WorkerServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "RunTest", - Handler: _Worker_RunTest_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "RunServer", - Handler: _Worker_RunServer_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, -} - -var fileDescriptor0 = []byte{ - // 988 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x56, 0x5f, 0x6f, 0x1b, 0x45, - 0x10, 0xef, 0xc5, 0xff, 0xe2, 0x39, 0x27, 0x44, 0xab, 0x52, 0x39, 0x69, 0x11, 0x70, 0x05, 0x11, - 0x22, 0x91, 0x56, 0x46, 0x42, 0xea, 0x0b, 0x91, 0xeb, 0x1a, 0x52, 0x29, 0x71, 0xa2, 0xbd, 0x04, - 0xd4, 0xa7, 0xd3, 0xc6, 0xde, 0xb8, 0xa7, 0x9c, 0xef, 0xae, 0xb7, 0x7b, 0xa8, 0xe6, 0x09, 0xf1, - 0x19, 0xf8, 0x0a, 0x3c, 0x20, 0xbe, 0x24, 0xb3, 0xb3, 0x7b, 0x89, 0x9d, 0x9a, 0x36, 0x52, 0x9f, - 0x72, 0x3b, 0xf3, 0x9b, 0xdf, 0xce, 0xfe, 0xe6, 0x8f, 0x03, 0xa0, 0xa5, 0xd2, 0xfb, 0x79, 0x91, - 0xe9, 0x8c, 0x75, 0xa6, 0x45, 0x3e, 0xde, 0x37, 0x86, 0x38, 0x9d, 0x06, 0xdf, 0x42, 0x27, 0xd4, - 0x42, 0x2b, 0x2e, 0xdf, 0x94, 0x68, 0x62, 0xdb, 0xb0, 0x6e, 0x5c, 0x51, 0x5a, 0xce, 0xba, 0xde, - 0x17, 0xde, 0x6e, 0x83, 0xb7, 0xcc, 0x79, 0x54, 0xce, 0x82, 0x14, 0xfc, 0x50, 0x16, 0xbf, 0xc9, - 0x82, 0x02, 0xd8, 0x97, 0xd0, 0xd1, 0xf1, 0x4c, 0x46, 0x32, 0x11, 0xb9, 0x92, 0x13, 0x42, 0x7b, - 0xdc, 0x37, 0xb6, 0xa1, 0x35, 0xb1, 0x87, 0xd0, 0x26, 0x48, 0xa9, 0x64, 0xd1, 0x5d, 0x23, 0xff, - 0xba, 0x31, 0x9c, 0xe3, 0x99, 0x7d, 0x0e, 0x84, 0x8d, 0xd4, 0x5c, 0x69, 0x39, 0xeb, 0xd6, 0xc8, - 0x0d, 0xc6, 0x14, 0x92, 0x25, 0x38, 0x82, 0xd6, 0xa9, 0x98, 0x27, 0x99, 0x98, 0xb0, 0xef, 0xa0, - 0xae, 0xe7, 0xb9, 0xa4, 0x3b, 0x36, 0x7b, 0xdb, 0xfb, 0x8b, 0x4f, 0xd8, 0x77, 0xa0, 0x33, 0x04, - 0x70, 0x82, 0x31, 0x06, 0xf5, 0x8b, 0x6c, 0x32, 0xa7, 0x2b, 0x3b, 0x9c, 0xbe, 0x83, 0x7f, 0x3d, - 0xd8, 0x38, 0x8c, 0x95, 0xce, 0xa6, 0x85, 0x98, 0xbd, 0x10, 0x5a, 0xb0, 0x07, 0xd0, 0xbc, 0x28, - 0xc7, 0x57, 0x52, 0x23, 0x6d, 0x6d, 0x77, 0x83, 0xbb, 0x93, 0x91, 0x60, 0x16, 0xa7, 0x91, 0x92, - 0x32, 0x75, 0x49, 0xb7, 0xf0, 0x1c, 0xe2, 0x91, 0x5c, 0xe2, 0xad, 0x75, 0xd5, 0x9c, 0x4b, 0xbc, - 0x25, 0xd7, 0x16, 0xd4, 0x14, 0x6a, 0x56, 0x27, 0xab, 0xf9, 0x64, 0x5f, 0xc1, 0x26, 0xfe, 0x89, - 0xb2, 0xcb, 0x48, 0xbd, 0x29, 0x45, 0x21, 0x55, 0xb7, 0x41, 0xce, 0x0e, 0x5a, 0x4f, 0x2e, 0x43, - 0x6b, 0x63, 0xf7, 0xa1, 0x31, 0xce, 0xca, 0x54, 0x77, 0x9b, 0xe4, 0xb4, 0x87, 0xe0, 0x8f, 0x1a, - 0x74, 0x06, 0x49, 0x2c, 0x53, 0x3d, 0xc8, 0xd2, 0xcb, 0x78, 0xca, 0xbe, 0x46, 0x32, 0x12, 0x3f, - 0xd2, 0xa2, 0x98, 0x4a, 0xad, 0x28, 0xe9, 0x36, 0xdf, 0xb0, 0xd6, 0x33, 0x6b, 0x64, 0xcf, 0xc0, - 0x1f, 0x53, 0x58, 0x44, 0x7a, 0xad, 0x91, 0x5e, 0xdd, 0x65, 0xbd, 0x2c, 0x2f, 0xc9, 0x05, 0xe3, - 0xeb, 0x6f, 0xf6, 0x19, 0x80, 0x4c, 0xc5, 0x45, 0x82, 0x15, 0x51, 0x09, 0xbd, 0x6e, 0x9d, 0xb7, - 0xad, 0x25, 0x54, 0x09, 0x3b, 0x80, 0x47, 0x59, 0xa9, 0x95, 0x16, 0xe9, 0x04, 0x49, 0x22, 0x24, - 0x54, 0x51, 0x8e, 0xe9, 0x8c, 0x5f, 0x8b, 0x34, 0x95, 0x09, 0x3d, 0xbc, 0xc1, 0xb7, 0x17, 0x30, - 0x1c, 0x21, 0xa7, 0xb2, 0x18, 0x58, 0x00, 0xfb, 0x06, 0x3e, 0x71, 0xa9, 0xb9, 0x10, 0xab, 0x47, - 0x83, 0x6f, 0x5a, 0xb3, 0xc3, 0x51, 0x63, 0xe5, 0xb6, 0xa4, 0x91, 0x8a, 0x7f, 0x97, 0x24, 0x4c, - 0x83, 0xfb, 0xce, 0x16, 0xa2, 0x89, 0x3d, 0x85, 0xfb, 0x42, 0xcd, 0xd3, 0x71, 0x54, 0x3d, 0xf6, - 0x75, 0x21, 0xc5, 0x44, 0x75, 0x5b, 0x04, 0x65, 0xe4, 0x73, 0xcf, 0xb4, 0x1e, 0x8c, 0x58, 0xc7, - 0x94, 0xad, 0x2a, 0xeb, 0xa4, 0xca, 0xa7, 0xcb, 0xaa, 0x60, 0xb6, 0x24, 0x49, 0xab, 0xb0, 0x1f, - 0x41, 0x13, 0xea, 0xc7, 0xa2, 0xb8, 0x0a, 0x4a, 0x00, 0x4b, 0xd5, 0x2f, 0xa6, 0x8a, 0xf5, 0xa0, - 0xa1, 0xa4, 0x2e, 0x73, 0x6a, 0x45, 0xbf, 0xb7, 0xb3, 0x4a, 0x5a, 0x5b, 0xb2, 0xc3, 0x7b, 0xdc, - 0x42, 0xd9, 0x2e, 0xd4, 0x67, 0xc8, 0x44, 0xd5, 0xf0, 0x7b, 0x6c, 0x39, 0xc4, 0xdc, 0x81, 0x50, - 0x42, 0x3c, 0x6f, 0x43, 0x0b, 0x0b, 0x69, 0x92, 0x0c, 0xfe, 0xf1, 0xc0, 0xb7, 0x74, 0x76, 0xdc, - 0x9e, 0x41, 0x3b, 0x11, 0x5a, 0xa6, 0xe3, 0x58, 0x2a, 0x77, 0xf9, 0xc3, 0x65, 0xa6, 0xa5, 0xee, - 0xe6, 0x37, 0xe8, 0x77, 0x26, 0xb5, 0xf6, 0x81, 0x49, 0xad, 0xbf, 0x7f, 0x52, 0x1b, 0xef, 0x4c, - 0xea, 0x41, 0xd5, 0xac, 0x26, 0xd5, 0x52, 0xb1, 0x27, 0x28, 0x92, 0x49, 0xda, 0xe5, 0xb9, 0xbd, - 0x4a, 0x24, 0xbb, 0x75, 0x2c, 0x2e, 0xf8, 0xd3, 0xc3, 0x35, 0x44, 0x8d, 0xec, 0xda, 0x1d, 0xfb, - 0xb8, 0x6a, 0xf7, 0x9b, 0xb9, 0xbf, 0xd5, 0xc7, 0x36, 0xc0, 0xf6, 0xb1, 0xba, 0xfe, 0x66, 0x5d, - 0x68, 0x55, 0xed, 0xb0, 0xe6, 0x16, 0x98, 0xeb, 0x81, 0xf7, 0x77, 0xb8, 0x29, 0xb4, 0xa5, 0xbc, - 0x43, 0xa1, 0x17, 0x93, 0xfd, 0xc8, 0x42, 0x87, 0xd5, 0xd3, 0xef, 0x24, 0xde, 0xc2, 0x06, 0x76, - 0xe2, 0x99, 0x6d, 0x97, 0x67, 0x85, 0x76, 0xaf, 0xa5, 0xef, 0xe0, 0x6f, 0xdc, 0x76, 0x61, 0x3c, - 0xcb, 0x13, 0x59, 0x2d, 0xf6, 0x1f, 0x61, 0x03, 0xd7, 0x4d, 0x9e, 0xa5, 0x4a, 0x46, 0x77, 0xdb, - 0xa5, 0x9d, 0x0a, 0x4f, 0xb2, 0x3e, 0x5e, 0x88, 0xa7, 0xb1, 0xb4, 0xd7, 0x5d, 0x83, 0x68, 0x2e, - 0x9f, 0x40, 0xcb, 0x8d, 0x29, 0xc9, 0xeb, 0xdf, 0x1e, 0x32, 0x47, 0xcf, 0x2b, 0x54, 0xd0, 0x87, - 0xcd, 0x2a, 0x4d, 0x4b, 0xb3, 0x48, 0xe1, 0xdd, 0x85, 0x62, 0xef, 0x00, 0xfc, 0x85, 0xac, 0x71, - 0x0f, 0x77, 0x06, 0x27, 0xc7, 0xa7, 0x7c, 0x18, 0x86, 0xfd, 0xe7, 0x47, 0xc3, 0xad, 0x7b, 0xa8, - 0xcf, 0xe6, 0xf9, 0x68, 0xc9, 0xe6, 0x31, 0x80, 0x26, 0xef, 0x8f, 0x5e, 0x9c, 0x1c, 0x6f, 0xad, - 0xed, 0xfd, 0x50, 0x0d, 0x38, 0xc5, 0x3f, 0x00, 0x16, 0xbe, 0x1a, 0x0d, 0x0e, 0xf9, 0xc9, 0xe8, - 0xe4, 0x3c, 0x8c, 0x06, 0x47, 0x2f, 0x87, 0xa3, 0x33, 0x64, 0x41, 0xde, 0xbe, 0x71, 0x54, 0x16, - 0xcf, 0xc4, 0xdd, 0xb4, 0xe0, 0xed, 0xb8, 0x70, 0xc8, 0x7f, 0x19, 0xf2, 0xc5, 0x38, 0x67, 0xf1, - 0xf6, 0x1e, 0x43, 0xcb, 0x2d, 0x1b, 0xd6, 0x86, 0xc6, 0xf9, 0xa8, 0xcf, 0x5f, 0x21, 0x6e, 0x03, - 0xda, 0xe1, 0x19, 0x1f, 0xf6, 0x8f, 0x5f, 0x8e, 0x7e, 0xde, 0xf2, 0x7a, 0x58, 0x40, 0xff, 0x0c, - 0x9f, 0x6c, 0x6e, 0x88, 0xc7, 0x92, 0xfd, 0x04, 0xed, 0xf3, 0x54, 0x14, 0xf3, 0x81, 0x48, 0x12, - 0x76, 0x6b, 0xf0, 0x97, 0x0a, 0xbd, 0xf3, 0x68, 0xb5, 0xd3, 0xc9, 0x3b, 0xc2, 0xbe, 0xd0, 0x38, - 0x0e, 0xf8, 0x8b, 0x36, 0xfd, 0x48, 0xae, 0x5d, 0xef, 0xa9, 0xd7, 0xfb, 0xcb, 0x83, 0xe6, 0xaf, - 0x59, 0x71, 0x85, 0x6b, 0x62, 0x80, 0xef, 0x2a, 0x53, 0x93, 0x34, 0x5b, 0xf9, 0x8b, 0x63, 0xc6, - 0x6a, 0x67, 0xe7, 0xff, 0x76, 0x41, 0xa9, 0x0c, 0x1f, 0x1b, 0x42, 0x1b, 0x49, 0xac, 0xae, 0x6c, - 0xe5, 0xc0, 0xaf, 0xa2, 0x59, 0x1c, 0x20, 0x43, 0x73, 0xd1, 0xa4, 0xff, 0x75, 0xbe, 0xff, 0x2f, - 0x00, 0x00, 0xff, 0xff, 0xe3, 0xb1, 0x00, 0x4d, 0xf9, 0x08, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/grpc/benchmark/grpc_testing/test.proto b/vendor/google.golang.org/grpc/benchmark/grpc_testing/test.proto deleted file mode 100644 index b0b2f80b56f..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/grpc_testing/test.proto +++ /dev/null @@ -1,148 +0,0 @@ -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. -syntax = "proto3"; - -package grpc.testing; - -enum PayloadType { - // Compressable text format. - COMPRESSABLE = 0; - - // Uncompressable binary format. - UNCOMPRESSABLE = 1; - - // Randomly chosen from all other formats defined in this enum. - RANDOM = 2; -} - -message StatsRequest { - // run number - int32 test_num = 1; -} - -message ServerStats { - // wall clock time - double time_elapsed = 1; - - // user time used by the server process and threads - double time_user = 2; - - // server time used by the server process and all threads - double time_system = 3; -} - -message Payload { - // The type of data in body. - PayloadType type = 1; - // Primary contents of payload. - bytes body = 2; -} - -message HistogramData { - repeated uint32 bucket = 1; - double min_seen = 2; - double max_seen = 3; - double sum = 4; - double sum_of_squares = 5; - double count = 6; -} - -enum ClientType { - SYNCHRONOUS_CLIENT = 0; - ASYNC_CLIENT = 1; -} - -enum ServerType { - SYNCHRONOUS_SERVER = 0; - ASYNC_SERVER = 1; -} - -enum RpcType { - UNARY = 0; - STREAMING = 1; -} - -message ClientConfig { - repeated string server_targets = 1; - ClientType client_type = 2; - bool enable_ssl = 3; - int32 outstanding_rpcs_per_channel = 4; - int32 client_channels = 5; - int32 payload_size = 6; - // only for async client: - int32 async_client_threads = 7; - RpcType rpc_type = 8; -} - -// Request current stats -message Mark {} - -message ClientArgs { - oneof argtype { - ClientConfig setup = 1; - Mark mark = 2; - } -} - -message ClientStats { - HistogramData latencies = 1; - double time_elapsed = 3; - double time_user = 4; - double time_system = 5; -} - -message ClientStatus { - ClientStats stats = 1; -} - -message ServerConfig { - ServerType server_type = 1; - int32 threads = 2; - bool enable_ssl = 3; -} - -message ServerArgs { - oneof argtype { - ServerConfig setup = 1; - Mark mark = 2; - } -} - -message ServerStatus { - ServerStats stats = 1; - int32 port = 2; -} - -message SimpleRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - PayloadType response_type = 1; - - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - int32 response_size = 2; - - // Optional input payload sent along with the request. - Payload payload = 3; -} - -message SimpleResponse { - Payload payload = 1; -} - -service TestService { - // One request followed by one response. - // The server returns the client payload as-is. - rpc UnaryCall(SimpleRequest) returns (SimpleResponse); - - // One request followed by one response. - // The server returns the client payload as-is. - rpc StreamingCall(stream SimpleRequest) returns (stream SimpleResponse); -} - -service Worker { - // Start test with specified workload - rpc RunTest(stream ClientArgs) returns (stream ClientStatus); - // Start test with specified workload - rpc RunServer(stream ServerArgs) returns (stream ServerStatus); -} diff --git a/vendor/google.golang.org/grpc/benchmark/server/main.go b/vendor/google.golang.org/grpc/benchmark/server/main.go deleted file mode 100644 index 090f002fa1b..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/server/main.go +++ /dev/null @@ -1,35 +0,0 @@ -package main - -import ( - "flag" - "math" - "net" - "net/http" - _ "net/http/pprof" - "time" - - "google.golang.org/grpc/benchmark" - "google.golang.org/grpc/grpclog" -) - -var ( - duration = flag.Int("duration", math.MaxInt32, "The duration in seconds to run the benchmark server") -) - -func main() { - flag.Parse() - go func() { - lis, err := net.Listen("tcp", ":0") - if err != nil { - grpclog.Fatalf("Failed to listen: %v", err) - } - grpclog.Println("Server profiling address: ", lis.Addr().String()) - if err := http.Serve(lis, nil); err != nil { - grpclog.Fatalf("Failed to serve: %v", err) - } - }() - addr, stopper := benchmark.StartServer(":0") // listen on all interfaces - grpclog.Println("Server Address: ", addr) - <-time.After(time.Duration(*duration) * time.Second) - stopper() -} diff --git a/vendor/google.golang.org/grpc/benchmark/stats/counter.go b/vendor/google.golang.org/grpc/benchmark/stats/counter.go deleted file mode 100644 index 4389bae38ce..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/stats/counter.go +++ /dev/null @@ -1,135 +0,0 @@ -package stats - -import ( - "sync" - "time" -) - -var ( - // TimeNow is used for testing. - TimeNow = time.Now -) - -const ( - hour = 0 - tenminutes = 1 - minute = 2 -) - -// Counter is a counter that keeps track of its recent values over a given -// period of time, and with a given resolution. Use newCounter() to instantiate. -type Counter struct { - mu sync.RWMutex - ts [3]*timeseries - lastUpdate time.Time -} - -// newCounter returns a new Counter. -func newCounter() *Counter { - now := TimeNow() - c := &Counter{} - c.ts[hour] = newTimeSeries(now, time.Hour, time.Minute) - c.ts[tenminutes] = newTimeSeries(now, 10*time.Minute, 10*time.Second) - c.ts[minute] = newTimeSeries(now, time.Minute, time.Second) - return c -} - -func (c *Counter) advance() time.Time { - now := TimeNow() - for _, ts := range c.ts { - ts.advanceTime(now) - } - return now -} - -// Value returns the current value of the counter. -func (c *Counter) Value() int64 { - c.mu.RLock() - defer c.mu.RUnlock() - return c.ts[minute].headValue() -} - -// LastUpdate returns the last update time of the counter. -func (c *Counter) LastUpdate() time.Time { - c.mu.RLock() - defer c.mu.RUnlock() - return c.lastUpdate -} - -// Set updates the current value of the counter. -func (c *Counter) Set(value int64) { - c.mu.Lock() - defer c.mu.Unlock() - c.lastUpdate = c.advance() - for _, ts := range c.ts { - ts.set(value) - } -} - -// Incr increments the current value of the counter by 'delta'. -func (c *Counter) Incr(delta int64) { - c.mu.Lock() - defer c.mu.Unlock() - c.lastUpdate = c.advance() - for _, ts := range c.ts { - ts.incr(delta) - } -} - -// Delta1h returns the delta for the last hour. -func (c *Counter) Delta1h() int64 { - c.mu.RLock() - defer c.mu.RUnlock() - c.advance() - return c.ts[hour].delta() -} - -// Delta10m returns the delta for the last 10 minutes. -func (c *Counter) Delta10m() int64 { - c.mu.RLock() - defer c.mu.RUnlock() - c.advance() - return c.ts[tenminutes].delta() -} - -// Delta1m returns the delta for the last minute. -func (c *Counter) Delta1m() int64 { - c.mu.RLock() - defer c.mu.RUnlock() - c.advance() - return c.ts[minute].delta() -} - -// Rate1h returns the rate of change of the counter in the last hour. -func (c *Counter) Rate1h() float64 { - c.mu.RLock() - defer c.mu.RUnlock() - c.advance() - return c.ts[hour].rate() -} - -// Rate10m returns the rate of change of the counter in the last 10 minutes. -func (c *Counter) Rate10m() float64 { - c.mu.RLock() - defer c.mu.RUnlock() - c.advance() - return c.ts[tenminutes].rate() -} - -// Rate1m returns the rate of change of the counter in the last minute. -func (c *Counter) Rate1m() float64 { - c.mu.RLock() - defer c.mu.RUnlock() - c.advance() - return c.ts[minute].rate() -} - -// Reset resets the counter to an empty state. -func (c *Counter) Reset() { - c.mu.Lock() - defer c.mu.Unlock() - now := TimeNow() - for _, ts := range c.ts { - ts.reset(now) - } -} diff --git a/vendor/google.golang.org/grpc/benchmark/stats/histogram.go b/vendor/google.golang.org/grpc/benchmark/stats/histogram.go deleted file mode 100644 index 727808c8bab..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/stats/histogram.go +++ /dev/null @@ -1,255 +0,0 @@ -package stats - -import ( - "bytes" - "fmt" - "io" - "strconv" - "strings" - "time" -) - -// HistogramValue is the value of Histogram objects. -type HistogramValue struct { - // Count is the total number of values added to the histogram. - Count int64 - // Sum is the sum of all the values added to the histogram. - Sum int64 - // Min is the minimum of all the values added to the histogram. - Min int64 - // Max is the maximum of all the values added to the histogram. - Max int64 - // Buckets contains all the buckets of the histogram. - Buckets []HistogramBucket -} - -// HistogramBucket is one histogram bucket. -type HistogramBucket struct { - // LowBound is the lower bound of the bucket. - LowBound int64 - // Count is the number of values in the bucket. - Count int64 -} - -// Print writes textual output of the histogram values. -func (v HistogramValue) Print(w io.Writer) { - avg := float64(v.Sum) / float64(v.Count) - fmt.Fprintf(w, "Count: %d Min: %d Max: %d Avg: %.2f\n", v.Count, v.Min, v.Max, avg) - fmt.Fprintf(w, "%s\n", strings.Repeat("-", 60)) - if v.Count <= 0 { - return - } - - maxBucketDigitLen := len(strconv.FormatInt(v.Buckets[len(v.Buckets)-1].LowBound, 10)) - if maxBucketDigitLen < 3 { - // For "inf". - maxBucketDigitLen = 3 - } - maxCountDigitLen := len(strconv.FormatInt(v.Count, 10)) - percentMulti := 100 / float64(v.Count) - - accCount := int64(0) - for i, b := range v.Buckets { - fmt.Fprintf(w, "[%*d, ", maxBucketDigitLen, b.LowBound) - if i+1 < len(v.Buckets) { - fmt.Fprintf(w, "%*d)", maxBucketDigitLen, v.Buckets[i+1].LowBound) - } else { - fmt.Fprintf(w, "%*s)", maxBucketDigitLen, "inf") - } - - accCount += b.Count - fmt.Fprintf(w, " %*d %5.1f%% %5.1f%%", maxCountDigitLen, b.Count, float64(b.Count)*percentMulti, float64(accCount)*percentMulti) - - const barScale = 0.1 - barLength := int(float64(b.Count)*percentMulti*barScale + 0.5) - fmt.Fprintf(w, " %s\n", strings.Repeat("#", barLength)) - } -} - -// String returns the textual output of the histogram values as string. -func (v HistogramValue) String() string { - var b bytes.Buffer - v.Print(&b) - return b.String() -} - -// A Histogram accumulates values in the form of a histogram. The type of the -// values is int64, which is suitable for keeping track of things like RPC -// latency in milliseconds. New histogram objects should be obtained via the -// New() function. -type Histogram struct { - opts HistogramOptions - buckets []bucketInternal - count *Counter - sum *Counter - tracker *Tracker -} - -// HistogramOptions contains the parameters that define the histogram's buckets. -type HistogramOptions struct { - // NumBuckets is the number of buckets. - NumBuckets int - // GrowthFactor is the growth factor of the buckets. A value of 0.1 - // indicates that bucket N+1 will be 10% larger than bucket N. - GrowthFactor float64 - // SmallestBucketSize is the size of the first bucket. Bucket sizes are - // rounded down to the nearest integer. - SmallestBucketSize float64 - // MinValue is the lower bound of the first bucket. - MinValue int64 -} - -// bucketInternal is the internal representation of a bucket, which includes a -// rate counter. -type bucketInternal struct { - lowBound int64 - count *Counter -} - -// NewHistogram returns a pointer to a new Histogram object that was created -// with the provided options. -func NewHistogram(opts HistogramOptions) *Histogram { - if opts.NumBuckets == 0 { - opts.NumBuckets = 32 - } - if opts.SmallestBucketSize == 0.0 { - opts.SmallestBucketSize = 1.0 - } - h := Histogram{ - opts: opts, - buckets: make([]bucketInternal, opts.NumBuckets), - count: newCounter(), - sum: newCounter(), - tracker: newTracker(), - } - low := opts.MinValue - delta := opts.SmallestBucketSize - for i := 0; i < opts.NumBuckets; i++ { - h.buckets[i].lowBound = low - h.buckets[i].count = newCounter() - low = low + int64(delta) - delta = delta * (1.0 + opts.GrowthFactor) - } - return &h -} - -// Opts returns a copy of the options used to create the Histogram. -func (h *Histogram) Opts() HistogramOptions { - return h.opts -} - -// Add adds a value to the histogram. -func (h *Histogram) Add(value int64) error { - bucket, err := h.findBucket(value) - if err != nil { - return err - } - h.buckets[bucket].count.Incr(1) - h.count.Incr(1) - h.sum.Incr(value) - h.tracker.Push(value) - return nil -} - -// LastUpdate returns the time at which the object was last updated. -func (h *Histogram) LastUpdate() time.Time { - return h.count.LastUpdate() -} - -// Value returns the accumulated state of the histogram since it was created. -func (h *Histogram) Value() HistogramValue { - b := make([]HistogramBucket, len(h.buckets)) - for i, v := range h.buckets { - b[i] = HistogramBucket{ - LowBound: v.lowBound, - Count: v.count.Value(), - } - } - - v := HistogramValue{ - Count: h.count.Value(), - Sum: h.sum.Value(), - Min: h.tracker.Min(), - Max: h.tracker.Max(), - Buckets: b, - } - return v -} - -// Delta1h returns the change in the last hour. -func (h *Histogram) Delta1h() HistogramValue { - b := make([]HistogramBucket, len(h.buckets)) - for i, v := range h.buckets { - b[i] = HistogramBucket{ - LowBound: v.lowBound, - Count: v.count.Delta1h(), - } - } - - v := HistogramValue{ - Count: h.count.Delta1h(), - Sum: h.sum.Delta1h(), - Min: h.tracker.Min1h(), - Max: h.tracker.Max1h(), - Buckets: b, - } - return v -} - -// Delta10m returns the change in the last 10 minutes. -func (h *Histogram) Delta10m() HistogramValue { - b := make([]HistogramBucket, len(h.buckets)) - for i, v := range h.buckets { - b[i] = HistogramBucket{ - LowBound: v.lowBound, - Count: v.count.Delta10m(), - } - } - - v := HistogramValue{ - Count: h.count.Delta10m(), - Sum: h.sum.Delta10m(), - Min: h.tracker.Min10m(), - Max: h.tracker.Max10m(), - Buckets: b, - } - return v -} - -// Delta1m returns the change in the last 10 minutes. -func (h *Histogram) Delta1m() HistogramValue { - b := make([]HistogramBucket, len(h.buckets)) - for i, v := range h.buckets { - b[i] = HistogramBucket{ - LowBound: v.lowBound, - Count: v.count.Delta1m(), - } - } - - v := HistogramValue{ - Count: h.count.Delta1m(), - Sum: h.sum.Delta1m(), - Min: h.tracker.Min1m(), - Max: h.tracker.Max1m(), - Buckets: b, - } - return v -} - -// findBucket does a binary search to find in which bucket the value goes. -func (h *Histogram) findBucket(value int64) (int, error) { - lastBucket := len(h.buckets) - 1 - min, max := 0, lastBucket - for max >= min { - b := (min + max) / 2 - if value >= h.buckets[b].lowBound && (b == lastBucket || value < h.buckets[b+1].lowBound) { - return b, nil - } - if value < h.buckets[b].lowBound { - max = b - 1 - continue - } - min = b + 1 - } - return 0, fmt.Errorf("no bucket for value: %d", value) -} diff --git a/vendor/google.golang.org/grpc/benchmark/stats/stats.go b/vendor/google.golang.org/grpc/benchmark/stats/stats.go deleted file mode 100644 index 4290ad77e54..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/stats/stats.go +++ /dev/null @@ -1,116 +0,0 @@ -package stats - -import ( - "bytes" - "fmt" - "io" - "math" - "time" -) - -// Stats is a simple helper for gathering additional statistics like histogram -// during benchmarks. This is not thread safe. -type Stats struct { - numBuckets int - unit time.Duration - min, max int64 - histogram *Histogram - - durations durationSlice - dirty bool -} - -type durationSlice []time.Duration - -// NewStats creates a new Stats instance. If numBuckets is not positive, -// the default value (16) will be used. -func NewStats(numBuckets int) *Stats { - if numBuckets <= 0 { - numBuckets = 16 - } - return &Stats{ - // Use one more bucket for the last unbounded bucket. - numBuckets: numBuckets + 1, - durations: make(durationSlice, 0, 100000), - } -} - -// Add adds an elapsed time per operation to the stats. -func (stats *Stats) Add(d time.Duration) { - stats.durations = append(stats.durations, d) - stats.dirty = true -} - -// Clear resets the stats, removing all values. -func (stats *Stats) Clear() { - stats.durations = stats.durations[:0] - stats.histogram = nil - stats.dirty = false -} - -// maybeUpdate updates internal stat data if there was any newly added -// stats since this was updated. -func (stats *Stats) maybeUpdate() { - if !stats.dirty { - return - } - - stats.min = math.MaxInt64 - stats.max = 0 - for _, d := range stats.durations { - if stats.min > int64(d) { - stats.min = int64(d) - } - if stats.max < int64(d) { - stats.max = int64(d) - } - } - - // Use the largest unit that can represent the minimum time duration. - stats.unit = time.Nanosecond - for _, u := range []time.Duration{time.Microsecond, time.Millisecond, time.Second} { - if stats.min <= int64(u) { - break - } - stats.unit = u - } - - // Adjust the min/max according to the new unit. - stats.min /= int64(stats.unit) - stats.max /= int64(stats.unit) - numBuckets := stats.numBuckets - if n := int(stats.max - stats.min + 1); n < numBuckets { - numBuckets = n - } - stats.histogram = NewHistogram(HistogramOptions{ - NumBuckets: numBuckets, - // max(i.e., Nth lower bound) = min + (1 + growthFactor)^(numBuckets-2). - GrowthFactor: math.Pow(float64(stats.max-stats.min), 1/float64(stats.numBuckets-2)) - 1, - SmallestBucketSize: 1.0, - MinValue: stats.min}) - - for _, d := range stats.durations { - stats.histogram.Add(int64(d / stats.unit)) - } - - stats.dirty = false -} - -// Print writes textual output of the Stats. -func (stats *Stats) Print(w io.Writer) { - stats.maybeUpdate() - - if stats.histogram == nil { - fmt.Fprint(w, "Histogram (empty)\n") - } else { - fmt.Fprintf(w, "Histogram (unit: %s)\n", fmt.Sprintf("%v", stats.unit)[1:]) - stats.histogram.Value().Print(w) - } -} - -// String returns the textual output of the Stats as string. -func (stats *Stats) String() string { - var b bytes.Buffer - stats.Print(&b) - return b.String() -} diff --git a/vendor/google.golang.org/grpc/benchmark/stats/timeseries.go b/vendor/google.golang.org/grpc/benchmark/stats/timeseries.go deleted file mode 100644 index 2ba18a4d4f3..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/stats/timeseries.go +++ /dev/null @@ -1,154 +0,0 @@ -package stats - -import ( - "math" - "time" -) - -// timeseries holds the history of a changing value over a predefined period of -// time. -type timeseries struct { - size int // The number of time slots. Equivalent to len(slots). - resolution time.Duration // The time resolution of each slot. - stepCount int64 // The number of intervals seen since creation. - head int // The position of the current time in slots. - time time.Time // The time at the beginning of the current time slot. - slots []int64 // A circular buffer of time slots. -} - -// newTimeSeries returns a newly allocated timeseries that covers the requested -// period with the given resolution. -func newTimeSeries(initialTime time.Time, period, resolution time.Duration) *timeseries { - size := int(period.Nanoseconds()/resolution.Nanoseconds()) + 1 - return ×eries{ - size: size, - resolution: resolution, - stepCount: 1, - time: initialTime, - slots: make([]int64, size), - } -} - -// advanceTimeWithFill moves the timeseries forward to time t and fills in any -// slots that get skipped in the process with the given value. Values older than -// the timeseries period are lost. -func (ts *timeseries) advanceTimeWithFill(t time.Time, value int64) { - advanceTo := t.Truncate(ts.resolution) - if !advanceTo.After(ts.time) { - // This is shortcut for the most common case of a busy counter - // where updates come in many times per ts.resolution. - ts.time = advanceTo - return - } - steps := int(advanceTo.Sub(ts.time).Nanoseconds() / ts.resolution.Nanoseconds()) - ts.stepCount += int64(steps) - if steps > ts.size { - steps = ts.size - } - for steps > 0 { - ts.head = (ts.head + 1) % ts.size - ts.slots[ts.head] = value - steps-- - } - ts.time = advanceTo -} - -// advanceTime moves the timeseries forward to time t and fills in any slots -// that get skipped in the process with the head value. Values older than the -// timeseries period are lost. -func (ts *timeseries) advanceTime(t time.Time) { - ts.advanceTimeWithFill(t, ts.slots[ts.head]) -} - -// set sets the current value of the timeseries. -func (ts *timeseries) set(value int64) { - ts.slots[ts.head] = value -} - -// incr sets the current value of the timeseries. -func (ts *timeseries) incr(delta int64) { - ts.slots[ts.head] += delta -} - -// headValue returns the latest value from the timeseries. -func (ts *timeseries) headValue() int64 { - return ts.slots[ts.head] -} - -// headTime returns the time of the latest value from the timeseries. -func (ts *timeseries) headTime() time.Time { - return ts.time -} - -// tailValue returns the oldest value from the timeseries. -func (ts *timeseries) tailValue() int64 { - if ts.stepCount < int64(ts.size) { - return 0 - } - return ts.slots[(ts.head+1)%ts.size] -} - -// tailTime returns the time of the oldest value from the timeseries. -func (ts *timeseries) tailTime() time.Time { - size := int64(ts.size) - if ts.stepCount < size { - size = ts.stepCount - } - return ts.time.Add(-time.Duration(size-1) * ts.resolution) -} - -// delta returns the difference between the newest and oldest values from the -// timeseries. -func (ts *timeseries) delta() int64 { - return ts.headValue() - ts.tailValue() -} - -// rate returns the rate of change between the oldest and newest values from -// the timeseries in units per second. -func (ts *timeseries) rate() float64 { - deltaTime := ts.headTime().Sub(ts.tailTime()).Seconds() - if deltaTime == 0 { - return 0 - } - return float64(ts.delta()) / deltaTime -} - -// min returns the smallest value from the timeseries. -func (ts *timeseries) min() int64 { - to := ts.size - if ts.stepCount < int64(ts.size) { - to = ts.head + 1 - } - tail := (ts.head + 1) % ts.size - min := int64(math.MaxInt64) - for b := 0; b < to; b++ { - if b != tail && ts.slots[b] < min { - min = ts.slots[b] - } - } - return min -} - -// max returns the largest value from the timeseries. -func (ts *timeseries) max() int64 { - to := ts.size - if ts.stepCount < int64(ts.size) { - to = ts.head + 1 - } - tail := (ts.head + 1) % ts.size - max := int64(math.MinInt64) - for b := 0; b < to; b++ { - if b != tail && ts.slots[b] > max { - max = ts.slots[b] - } - } - return max -} - -// reset resets the timeseries to an empty state. -func (ts *timeseries) reset(t time.Time) { - ts.head = 0 - ts.time = t - ts.stepCount = 1 - ts.slots = make([]int64, ts.size) -} diff --git a/vendor/google.golang.org/grpc/benchmark/stats/tracker.go b/vendor/google.golang.org/grpc/benchmark/stats/tracker.go deleted file mode 100644 index 802f72957b6..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/stats/tracker.go +++ /dev/null @@ -1,159 +0,0 @@ -package stats - -import ( - "math" - "sync" - "time" -) - -// Tracker is a min/max value tracker that keeps track of its min/max values -// over a given period of time, and with a given resolution. The initial min -// and max values are math.MaxInt64 and math.MinInt64 respectively. -type Tracker struct { - mu sync.RWMutex - min, max int64 // All time min/max. - minTS, maxTS [3]*timeseries - lastUpdate time.Time -} - -// newTracker returns a new Tracker. -func newTracker() *Tracker { - now := TimeNow() - t := &Tracker{} - t.minTS[hour] = newTimeSeries(now, time.Hour, time.Minute) - t.minTS[tenminutes] = newTimeSeries(now, 10*time.Minute, 10*time.Second) - t.minTS[minute] = newTimeSeries(now, time.Minute, time.Second) - t.maxTS[hour] = newTimeSeries(now, time.Hour, time.Minute) - t.maxTS[tenminutes] = newTimeSeries(now, 10*time.Minute, 10*time.Second) - t.maxTS[minute] = newTimeSeries(now, time.Minute, time.Second) - t.init() - return t -} - -func (t *Tracker) init() { - t.min = math.MaxInt64 - t.max = math.MinInt64 - for _, ts := range t.minTS { - ts.set(math.MaxInt64) - } - for _, ts := range t.maxTS { - ts.set(math.MinInt64) - } -} - -func (t *Tracker) advance() time.Time { - now := TimeNow() - for _, ts := range t.minTS { - ts.advanceTimeWithFill(now, math.MaxInt64) - } - for _, ts := range t.maxTS { - ts.advanceTimeWithFill(now, math.MinInt64) - } - return now -} - -// LastUpdate returns the last update time of the range. -func (t *Tracker) LastUpdate() time.Time { - t.mu.RLock() - defer t.mu.RUnlock() - return t.lastUpdate -} - -// Push adds a new value if it is a new minimum or maximum. -func (t *Tracker) Push(value int64) { - t.mu.Lock() - defer t.mu.Unlock() - t.lastUpdate = t.advance() - if t.min > value { - t.min = value - } - if t.max < value { - t.max = value - } - for _, ts := range t.minTS { - if ts.headValue() > value { - ts.set(value) - } - } - for _, ts := range t.maxTS { - if ts.headValue() < value { - ts.set(value) - } - } -} - -// Min returns the minimum value of the tracker -func (t *Tracker) Min() int64 { - t.mu.RLock() - defer t.mu.RUnlock() - return t.min -} - -// Max returns the maximum value of the tracker. -func (t *Tracker) Max() int64 { - t.mu.RLock() - defer t.mu.RUnlock() - return t.max -} - -// Min1h returns the minimum value for the last hour. -func (t *Tracker) Min1h() int64 { - t.mu.Lock() - defer t.mu.Unlock() - t.advance() - return t.minTS[hour].min() -} - -// Max1h returns the maximum value for the last hour. -func (t *Tracker) Max1h() int64 { - t.mu.Lock() - defer t.mu.Unlock() - t.advance() - return t.maxTS[hour].max() -} - -// Min10m returns the minimum value for the last 10 minutes. -func (t *Tracker) Min10m() int64 { - t.mu.Lock() - defer t.mu.Unlock() - t.advance() - return t.minTS[tenminutes].min() -} - -// Max10m returns the maximum value for the last 10 minutes. -func (t *Tracker) Max10m() int64 { - t.mu.Lock() - defer t.mu.Unlock() - t.advance() - return t.maxTS[tenminutes].max() -} - -// Min1m returns the minimum value for the last 1 minute. -func (t *Tracker) Min1m() int64 { - t.mu.Lock() - defer t.mu.Unlock() - t.advance() - return t.minTS[minute].min() -} - -// Max1m returns the maximum value for the last 1 minute. -func (t *Tracker) Max1m() int64 { - t.mu.Lock() - defer t.mu.Unlock() - t.advance() - return t.maxTS[minute].max() -} - -// Reset resets the range to an empty state. -func (t *Tracker) Reset() { - t.mu.Lock() - defer t.mu.Unlock() - now := TimeNow() - for _, ts := range t.minTS { - ts.reset(now) - } - for _, ts := range t.maxTS { - ts.reset(now) - } - t.init() -} diff --git a/vendor/google.golang.org/grpc/benchmark/stats/util.go b/vendor/google.golang.org/grpc/benchmark/stats/util.go deleted file mode 100644 index a9922f985f3..00000000000 --- a/vendor/google.golang.org/grpc/benchmark/stats/util.go +++ /dev/null @@ -1,191 +0,0 @@ -package stats - -import ( - "bufio" - "bytes" - "fmt" - "os" - "runtime" - "sort" - "strings" - "sync" - "testing" -) - -var ( - curB *testing.B - curBenchName string - curStats map[string]*Stats - - orgStdout *os.File - nextOutPos int - - injectCond *sync.Cond - injectDone chan struct{} -) - -// AddStats adds a new unnamed Stats instance to the current benchmark. You need -// to run benchmarks by calling RunTestMain() to inject the stats to the -// benchmark results. If numBuckets is not positive, the default value (16) will -// be used. Please note that this calls b.ResetTimer() since it may be blocked -// until the previous benchmark stats is printed out. So AddStats() should -// typically be called at the very beginning of each benchmark function. -func AddStats(b *testing.B, numBuckets int) *Stats { - return AddStatsWithName(b, "", numBuckets) -} - -// AddStatsWithName adds a new named Stats instance to the current benchmark. -// With this, you can add multiple stats in a single benchmark. You need -// to run benchmarks by calling RunTestMain() to inject the stats to the -// benchmark results. If numBuckets is not positive, the default value (16) will -// be used. Please note that this calls b.ResetTimer() since it may be blocked -// until the previous benchmark stats is printed out. So AddStatsWithName() -// should typically be called at the very beginning of each benchmark function. -func AddStatsWithName(b *testing.B, name string, numBuckets int) *Stats { - var benchName string - for i := 1; ; i++ { - pc, _, _, ok := runtime.Caller(i) - if !ok { - panic("benchmark function not found") - } - p := strings.Split(runtime.FuncForPC(pc).Name(), ".") - benchName = p[len(p)-1] - if strings.HasPrefix(benchName, "Benchmark") { - break - } - } - procs := runtime.GOMAXPROCS(-1) - if procs != 1 { - benchName = fmt.Sprintf("%s-%d", benchName, procs) - } - - stats := NewStats(numBuckets) - - if injectCond != nil { - // We need to wait until the previous benchmark stats is printed out. - injectCond.L.Lock() - for curB != nil && curBenchName != benchName { - injectCond.Wait() - } - - curB = b - curBenchName = benchName - curStats[name] = stats - - injectCond.L.Unlock() - } - - b.ResetTimer() - return stats -} - -// RunTestMain runs the tests with enabling injection of benchmark stats. It -// returns an exit code to pass to os.Exit. -func RunTestMain(m *testing.M) int { - startStatsInjector() - defer stopStatsInjector() - return m.Run() -} - -// startStatsInjector starts stats injection to benchmark results. -func startStatsInjector() { - orgStdout = os.Stdout - r, w, _ := os.Pipe() - os.Stdout = w - nextOutPos = 0 - - resetCurBenchStats() - - injectCond = sync.NewCond(&sync.Mutex{}) - injectDone = make(chan struct{}) - go func() { - defer close(injectDone) - - scanner := bufio.NewScanner(r) - scanner.Split(splitLines) - for scanner.Scan() { - injectStatsIfFinished(scanner.Text()) - } - if err := scanner.Err(); err != nil { - panic(err) - } - }() -} - -// stopStatsInjector stops stats injection and restores os.Stdout. -func stopStatsInjector() { - os.Stdout.Close() - <-injectDone - injectCond = nil - os.Stdout = orgStdout -} - -// splitLines is a split function for a bufio.Scanner that returns each line -// of text, teeing texts to the original stdout even before each line ends. -func splitLines(data []byte, eof bool) (advance int, token []byte, err error) { - if eof && len(data) == 0 { - return 0, nil, nil - } - - if i := bytes.IndexByte(data, '\n'); i >= 0 { - orgStdout.Write(data[nextOutPos : i+1]) - nextOutPos = 0 - return i + 1, data[0:i], nil - } - - orgStdout.Write(data[nextOutPos:]) - nextOutPos = len(data) - - if eof { - // This is a final, non-terminated line. Return it. - return len(data), data, nil - } - - return 0, nil, nil -} - -// injectStatsIfFinished prints out the stats if the current benchmark finishes. -func injectStatsIfFinished(line string) { - injectCond.L.Lock() - defer injectCond.L.Unlock() - - // We assume that the benchmark results start with the benchmark name. - if curB == nil || !strings.HasPrefix(line, curBenchName) { - return - } - - if !curB.Failed() { - // Output all stats in alphabetical order. - names := make([]string, 0, len(curStats)) - for name := range curStats { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - stats := curStats[name] - // The output of stats starts with a header like "Histogram (unit: ms)" - // followed by statistical properties and the buckets. Add the stats name - // if it is a named stats and indent them as Go testing outputs. - lines := strings.Split(stats.String(), "\n") - if n := len(lines); n > 0 { - if name != "" { - name = ": " + name - } - fmt.Fprintf(orgStdout, "--- %s%s\n", lines[0], name) - for _, line := range lines[1 : n-1] { - fmt.Fprintf(orgStdout, "\t%s\n", line) - } - } - } - } - - resetCurBenchStats() - injectCond.Signal() -} - -// resetCurBenchStats resets the current benchmark stats. -func resetCurBenchStats() { - curB = nil - curBenchName = "" - curStats = make(map[string]*Stats) -} diff --git a/vendor/google.golang.org/grpc/credentials/oauth/oauth.go b/vendor/google.golang.org/grpc/credentials/oauth/oauth.go deleted file mode 100644 index 04943fdf03b..00000000000 --- a/vendor/google.golang.org/grpc/credentials/oauth/oauth.go +++ /dev/null @@ -1,177 +0,0 @@ -/* - * - * Copyright 2015, 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. - * - */ - -// Package oauth implements gRPC credentials using OAuth. -package oauth - -import ( - "fmt" - "io/ioutil" - - "golang.org/x/net/context" - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" - "golang.org/x/oauth2/jwt" - "google.golang.org/grpc/credentials" -) - -// TokenSource supplies credentials from an oauth2.TokenSource. -type TokenSource struct { - oauth2.TokenSource -} - -// GetRequestMetadata gets the request metadata as a map from a TokenSource. -func (ts TokenSource) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { - token, err := ts.Token() - if err != nil { - return nil, err - } - return map[string]string{ - "authorization": token.TokenType + " " + token.AccessToken, - }, nil -} - -func (ts TokenSource) RequireTransportSecurity() bool { - return true -} - -type jwtAccess struct { - jsonKey []byte -} - -func NewJWTAccessFromFile(keyFile string) (credentials.Credentials, error) { - jsonKey, err := ioutil.ReadFile(keyFile) - if err != nil { - return nil, fmt.Errorf("credentials: failed to read the service account key file: %v", err) - } - return NewJWTAccessFromKey(jsonKey) -} - -func NewJWTAccessFromKey(jsonKey []byte) (credentials.Credentials, error) { - return jwtAccess{jsonKey}, nil -} - -func (j jwtAccess) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { - ts, err := google.JWTAccessTokenSourceFromJSON(j.jsonKey, uri[0]) - if err != nil { - return nil, err - } - token, err := ts.Token() - if err != nil { - return nil, err - } - return map[string]string{ - "authorization": token.TokenType + " " + token.AccessToken, - }, nil -} - -func (j jwtAccess) RequireTransportSecurity() bool { - return true -} - -// oauthAccess supplies credentials from a given token. -type oauthAccess struct { - token oauth2.Token -} - -// NewOauthAccess constructs the credentials using a given token. -func NewOauthAccess(token *oauth2.Token) credentials.Credentials { - return oauthAccess{token: *token} -} - -func (oa oauthAccess) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { - return map[string]string{ - "authorization": oa.token.TokenType + " " + oa.token.AccessToken, - }, nil -} - -func (oa oauthAccess) RequireTransportSecurity() bool { - return true -} - -// NewComputeEngine constructs the credentials that fetches access tokens from -// Google Compute Engine (GCE)'s metadata server. It is only valid to use this -// if your program is running on a GCE instance. -// TODO(dsymonds): Deprecate and remove this. -func NewComputeEngine() credentials.Credentials { - return TokenSource{google.ComputeTokenSource("")} -} - -// serviceAccount represents credentials via JWT signing key. -type serviceAccount struct { - config *jwt.Config -} - -func (s serviceAccount) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { - token, err := s.config.TokenSource(ctx).Token() - if err != nil { - return nil, err - } - return map[string]string{ - "authorization": token.TokenType + " " + token.AccessToken, - }, nil -} - -func (s serviceAccount) RequireTransportSecurity() bool { - return true -} - -// NewServiceAccountFromKey constructs the credentials using the JSON key slice -// from a Google Developers service account. -func NewServiceAccountFromKey(jsonKey []byte, scope ...string) (credentials.Credentials, error) { - config, err := google.JWTConfigFromJSON(jsonKey, scope...) - if err != nil { - return nil, err - } - return serviceAccount{config: config}, nil -} - -// NewServiceAccountFromFile constructs the credentials using the JSON key file -// of a Google Developers service account. -func NewServiceAccountFromFile(keyFile string, scope ...string) (credentials.Credentials, error) { - jsonKey, err := ioutil.ReadFile(keyFile) - if err != nil { - return nil, fmt.Errorf("credentials: failed to read the service account key file: %v", err) - } - return NewServiceAccountFromKey(jsonKey, scope...) -} - -// NewApplicationDefault returns "Application Default Credentials". For more -// detail, see https://developers.google.com/accounts/docs/application-default-credentials. -func NewApplicationDefault(ctx context.Context, scope ...string) (credentials.Credentials, error) { - t, err := google.DefaultTokenSource(ctx, scope...) - if err != nil { - return nil, err - } - return TokenSource{t}, nil -} diff --git a/vendor/google.golang.org/grpc/examples/README.md b/vendor/google.golang.org/grpc/examples/README.md deleted file mode 100644 index b65f8c5e632..00000000000 --- a/vendor/google.golang.org/grpc/examples/README.md +++ /dev/null @@ -1,57 +0,0 @@ -gRPC in 3 minutes (Go) -====================== - -BACKGROUND -------------- -For this sample, we've already generated the server and client stubs from [helloworld.proto](helloworld/helloworld/helloworld.proto). - -PREREQUISITES -------------- - -- This requires Go 1.4 -- Requires that [GOPATH is set](https://golang.org/doc/code.html#GOPATH) - -``` -$ go help gopath -$ # ensure the PATH contains $GOPATH/bin -$ export PATH=$PATH:$GOPATH/bin -``` - -INSTALL -------- - -``` -$ go get -u google.golang.org/grpc/examples/helloworld/greeter_client -$ go get -u google.golang.org/grpc/examples/helloworld/greeter_server -``` - -TRY IT! -------- - -- Run the server - -``` -$ greeter_server & -``` - -- Run the client - -``` -$ greeter_client -``` - -OPTIONAL - Rebuilding the generated code ----------------------------------------- - -1 First [install protoc](https://github.com/google/protobuf/blob/master/README.md) - - For now, this needs to be installed from source - - This is will change once proto3 is officially released - -2 Install the protoc Go plugin. - -``` -$ go get -a github.com/golang/protobuf/protoc-gen-go -$ -$ # from this dir; invoke protoc -$ protoc -I ./helloworld/helloworld/ ./helloworld/helloworld/helloworld.proto --go_out=plugins=grpc:helloworld -``` diff --git a/vendor/google.golang.org/grpc/examples/gotutorial.md b/vendor/google.golang.org/grpc/examples/gotutorial.md deleted file mode 100644 index 39833fdf3da..00000000000 --- a/vendor/google.golang.org/grpc/examples/gotutorial.md +++ /dev/null @@ -1,431 +0,0 @@ -#gRPC Basics: Go - -This tutorial provides a basic Go programmer's introduction to working with gRPC. By walking through this example you'll learn how to: - -- Define a service in a .proto file. -- Generate server and client code using the protocol buffer compiler. -- Use the Go gRPC API to write a simple client and server for your service. - -It assumes that you have read the [Getting started](https://github.com/grpc/grpc/tree/master/examples) guide and are familiar with [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). Note that the example in this tutorial uses the proto3 version of the protocol buffers language, which is currently in alpha release:you can find out more in the [proto3 language guide](https://developers.google.com/protocol-buffers/docs/proto3) and see the [release notes](https://github.com/google/protobuf/releases) for the new version in the protocol buffers Github repository. - -This isn't a comprehensive guide to using gRPC in Go: more reference documentation is coming soon. - -## Why use gRPC? - -Our example is a simple route mapping application that lets clients get information about features on their route, create a summary of their route, and exchange route information such as traffic updates with the server and other clients. - -With gRPC we can define our service once in a .proto file and implement clients and servers in any of gRPC's supported languages, which in turn can be run in environments ranging from servers inside Google to your own tablet - all the complexity of communication between different languages and environments is handled for you by gRPC. We also get all the advantages of working with protocol buffers, including efficient serialization, a simple IDL, and easy interface updating. - -## Example code and setup - -The example code for our tutorial is in [grpc/grpc-go/examples/route_guide](https://github.com/grpc/grpc-go/tree/master/examples/route_guide). To download the example, clone the `grpc-go` repository by running the following command: -```shell -$ go get google.golang.org/grpc -``` - -Then change your current directory to `grpc-go/examples/route_guide`: -```shell -$ cd $GOPATH/src/google.golang.org/grpc/examples/route_guide -``` - -You also should have the relevant tools installed to generate the server and client interface code - if you don't already, follow the setup instructions in [the Go quick start guide](examples/). - - -## Defining the service - -Our first step (as you'll know from the [quick start](http://www.grpc.io/docs/#quick-start)) is to define the gRPC *service* and the method *request* and *response* types using [protocol buffers] (https://developers.google.com/protocol-buffers/docs/overview). You can see the complete .proto file in [`examples/route_guide/proto/route_guide.proto`](examples/route_guide/proto/route_guide.proto). - -To define a service, you specify a named `service` in your .proto file: - -```proto -service RouteGuide { - ... -} -``` - -Then you define `rpc` methods inside your service definition, specifying their request and response types. gRPC lets you define four kinds of service method, all of which are used in the `RouteGuide` service: - -- A *simple RPC* where the client sends a request to the server using the stub and waits for a response to come back, just like a normal function call. -```proto - // Obtains the feature at a given position. - rpc GetFeature(Point) returns (Feature) {} -``` - -- A *server-side streaming RPC* where the client sends a request to the server and gets a stream to read a sequence of messages back. The client reads from the returned stream until there are no more messages. As you can see in our example, you specify a server-side streaming method by placing the `stream` keyword before the *response* type. -```proto - // Obtains the Features available within the given Rectangle. Results are - // streamed rather than returned at once (e.g. in a response message with a - // repeated field), as the rectangle may cover a large area and contain a - // huge number of features. - rpc ListFeatures(Rectangle) returns (stream Feature) {} -``` - -- A *client-side streaming RPC* where the client writes a sequence of messages and sends them to the server, again using a provided stream. Once the client has finished writing the messages, it waits for the server to read them all and return its response. You specify a client-side streaming method by placing the `stream` keyword before the *request* type. -```proto - // Accepts a stream of Points on a route being traversed, returning a - // RouteSummary when traversal is completed. - rpc RecordRoute(stream Point) returns (RouteSummary) {} -``` - -- A *bidirectional streaming RPC* where both sides send a sequence of messages using a read-write stream. The two streams operate independently, so clients and servers can read and write in whatever order they like: for example, the server could wait to receive all the client messages before writing its responses, or it could alternately read a message then write a message, or some other combination of reads and writes. The order of messages in each stream is preserved. You specify this type of method by placing the `stream` keyword before both the request and the response. -```proto - // Accepts a stream of RouteNotes sent while a route is being traversed, - // while receiving other RouteNotes (e.g. from other users). - rpc RouteChat(stream RouteNote) returns (stream RouteNote) {} -``` - -Our .proto file also contains protocol buffer message type definitions for all the request and response types used in our service methods - for example, here's the `Point` message type: -```proto -// Points are represented as latitude-longitude pairs in the E7 representation -// (degrees multiplied by 10**7 and rounded to the nearest integer). -// Latitudes should be in the range +/- 90 degrees and longitude should be in -// the range +/- 180 degrees (inclusive). -message Point { - int32 latitude = 1; - int32 longitude = 2; -} -``` - - -## Generating client and server code - -Next we need to generate the gRPC client and server interfaces from our .proto service definition. We do this using the protocol buffer compiler `protoc` with a special gRPC Go plugin. - -For simplicity, we've provided a [bash script](https://github.com/grpc/grpc-go/blob/master/codegen.sh) that runs `protoc` for you with the appropriate plugin, input, and output (if you want to run this by yourself, make sure you've installed protoc and followed the gRPC-Go [installation instructions](https://github.com/grpc/grpc-go/blob/master/README.md) first): - -```shell -$ codegen.sh route_guide.proto -``` - -which actually runs: - -```shell -$ protoc --go_out=plugins=grpc:. route_guide.proto -``` - -Running this command generates the following file in your current directory: -- `route_guide.pb.go` - -This contains: -- All the protocol buffer code to populate, serialize, and retrieve our request and response message types -- An interface type (or *stub*) for clients to call with the methods defined in the `RouteGuide` service. -- An interface type for servers to implement, also with the methods defined in the `RouteGuide` service. - - - -## Creating the server - -First let's look at how we create a `RouteGuide` server. If you're only interested in creating gRPC clients, you can skip this section and go straight to [Creating the client](#client) (though you might find it interesting anyway!). - -There are two parts to making our `RouteGuide` service do its job: -- Implementing the service interface generated from our service definition: doing the actual "work" of our service. -- Running a gRPC server to listen for requests from clients and dispatch them to the right service implementation. - -You can find our example `RouteGuide` server in [grpc-go/examples/route_guide/server/server.go](https://github.com/grpc/grpc-go/tree/master/examples/route_guide/server/server.go). Let's take a closer look at how it works. - -### Implementing RouteGuide - -As you can see, our server has a `routeGuideServer` struct type that implements the generated `RouteGuideServer` interface: - -```go -type routeGuideServer struct { - ... -} -... - -func (s *routeGuideServer) GetFeature(ctx context.Context, point *pb.Point) (*pb.Feature, error) { - ... -} -... - -func (s *routeGuideServer) ListFeatures(rect *pb.Rectangle, stream pb.RouteGuide_ListFeaturesServer) error { - ... -} -... - -func (s *routeGuideServer) RecordRoute(stream pb.RouteGuide_RecordRouteServer) error { - ... -} -... - -func (s *routeGuideServer) RouteChat(stream pb.RouteGuide_RouteChatServer) error { - ... -} -... -``` - -#### Simple RPC -`routeGuideServer` implements all our service methods. Let's look at the simplest type first, `GetFeature`, which just gets a `Point` from the client and returns the corresponding feature information from its database in a `Feature`. - -```go -func (s *routeGuideServer) GetFeature(ctx context.Context, point *pb.Point) (*pb.Feature, error) { - for _, feature := range s.savedFeatures { - if proto.Equal(feature.Location, point) { - return feature, nil - } - } - // No feature was found, return an unnamed feature - return &pb.Feature{"", point}, nil -} -``` - -The method is passed a context object for the RPC and the client's `Point` protocol buffer request. It returns a `Feature` protocol buffer object with the response information and an `error`. In the method we populate the `Feature` with the appropriate information, and then `return` it along with an `nil` error to tell gRPC that we've finished dealing with the RPC and that the `Feature` can be returned to the client. - -#### Server-side streaming RPC -Now let's look at one of our streaming RPCs. `ListFeatures` is a server-side streaming RPC, so we need to send back multiple `Feature`s to our client. - -```go -func (s *routeGuideServer) ListFeatures(rect *pb.Rectangle, stream pb.RouteGuide_ListFeaturesServer) error { - for _, feature := range s.savedFeatures { - if inRange(feature.Location, rect) { - if err := stream.Send(feature); err != nil { - return err - } - } - } - return nil -} -``` - -As you can see, instead of getting simple request and response objects in our method parameters, this time we get a request object (the `Rectangle` in which our client wants to find `Feature`s) and a special `RouteGuide_ListFeaturesServer` object to write our responses. - -In the method, we populate as many `Feature` objects as we need to return, writing them to the `RouteGuide_ListFeaturesServer` using its `Send()` method. Finally, as in our simple RPC, we return a `nil` error to tell gRPC that we've finished writing responses. Should any error happen in this call, we return a non-`nil` error; the gRPC layer will translate it into an appropriate RPC status to be sent on the wire. - -#### Client-side streaming RPC -Now let's look at something a little more complicated: the client-side streaming method `RecordRoute`, where we get a stream of `Point`s from the client and return a single `RouteSummary` with information about their trip. As you can see, this time the method doesn't have a request parameter at all. Instead, it gets a `RouteGuide_RecordRouteServer` stream, which the server can use to both read *and* write messages - it can receive client messages using its `Recv()` method and return its single response using its `SendAndClose()` method. - -```go -func (s *routeGuideServer) RecordRoute(stream pb.RouteGuide_RecordRouteServer) error { - var pointCount, featureCount, distance int32 - var lastPoint *pb.Point - startTime := time.Now() - for { - point, err := stream.Recv() - if err == io.EOF { - endTime := time.Now() - return stream.SendAndClose(&pb.RouteSummary{ - PointCount: pointCount, - FeatureCount: featureCount, - Distance: distance, - ElapsedTime: int32(endTime.Sub(startTime).Seconds()), - }) - } - if err != nil { - return err - } - pointCount++ - for _, feature := range s.savedFeatures { - if proto.Equal(feature.Location, point) { - featureCount++ - } - } - if lastPoint != nil { - distance += calcDistance(lastPoint, point) - } - lastPoint = point - } -} -``` - -In the method body we use the `RouteGuide_RecordRouteServer`s `Recv()` method to repeatedly read in our client's requests to a request object (in this case a `Point`) until there are no more messages: the server needs to check the the error returned from `Recv()` after each call. If this is `nil`, the stream is still good and it can continue reading; if it's `io.EOF` the message stream has ended and the server can return its `RouteSummary`. If it has any other value, we return the error "as is" so that it'll be translated to an RPC status by the gRPC layer. - -#### Bidirectional streaming RPC -Finally, let's look at our bidirectional streaming RPC `RouteChat()`. - -```go -func (s *routeGuideServer) RouteChat(stream pb.RouteGuide_RouteChatServer) error { - for { - in, err := stream.Recv() - if err == io.EOF { - return nil - } - if err != nil { - return err - } - key := serialize(in.Location) - ... // look for notes to be sent to client - for _, note := range s.routeNotes[key] { - if err := stream.Send(note); err != nil { - return err - } - } - } -} -``` - -This time we get a `RouteGuide_RouteChatServer` stream that, as in our client-side streaming example, can be used to read and write messages. However, this time we return values via our method's stream while the client is still writing messages to *their* message stream. - -The syntax for reading and writing here is very similar to our client-streaming method, except the server uses the stream's `Send()` method rather than `SendAndClose()` because it's writing multiple responses. Although each side will always get the other's messages in the order they were written, both the client and server can read and write in any order — the streams operate completely independently. - -### Starting the server - -Once we've implemented all our methods, we also need to start up a gRPC server so that clients can actually use our service. The following snippet shows how we do this for our `RouteGuide` service: - -```go -flag.Parse() -lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *port)) -if err != nil { - log.Fatalf("failed to listen: %v", err) -} -grpcServer := grpc.NewServer() -pb.RegisterRouteGuideServer(grpcServer, &routeGuideServer{}) -... // determine whether to use TLS -grpcServer.Serve(lis) -``` -To build and start a server, we: - -1. Specify the port we want to use to listen for client requests using `lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *port))`. -2. Create an instance of the gRPC server using `grpc.NewServer()`. -3. Register our service implementation with the gRPC server. -4. Call `Serve()` on the server with our port details to do a blocking wait until the process is killed or `Stop()` is called. - - -## Creating the client - -In this section, we'll look at creating a Go client for our `RouteGuide` service. You can see our complete example client code in [grpc-go/examples/route_guide/client/client.go](https://github.com/grpc/grpc-go/tree/master/examples/route_guide/client/client.go). - -### Creating a stub - -To call service methods, we first need to create a gRPC *channel* to communicate with the server. We create this by passing the server address and port number to `grpc.Dial()` as follows: - -```go -conn, err := grpc.Dial(*serverAddr) -if err != nil { - ... -} -defer conn.Close() -``` - -You can use `DialOptions` to set the auth credentials (e.g., TLS, GCE credentials, JWT credentials) in `grpc.Dial` if the service you request requires that - however, we don't need to do this for our `RouteGuide` service. - -Once the gRPC *channel* is setup, we need a client *stub* to perform RPCs. We get this using the `NewRouteGuideClient` method provided in the `pb` package we generated from our .proto. - -```go -client := pb.NewRouteGuideClient(conn) -``` - -### Calling service methods - -Now let's look at how we call our service methods. Note that in gRPC-Go, RPCs operate in a blocking/synchronous mode, which means that the RPC call waits for the server to respond, and will either return a response or an error. - -#### Simple RPC - -Calling the simple RPC `GetFeature` is nearly as straightforward as calling a local method. - -```go -feature, err := client.GetFeature(context.Background(), &pb.Point{409146138, -746188906}) -if err != nil { - ... -} -``` - -As you can see, we call the method on the stub we got earlier. In our method parameters we create and populate a request protocol buffer object (in our case `Point`). We also pass a `context.Context` object which lets us change our RPC's behaviour if necessary, such as time-out/cancel an RPC in flight. If the call doesn't return an error, then we can read the response information from the server from the first return value. - -```go -log.Println(feature) -``` - -#### Server-side streaming RPC - -Here's where we call the server-side streaming method `ListFeatures`, which returns a stream of geographical `Feature`s. If you've already read [Creating the server](#server) some of this may look very familiar - streaming RPCs are implemented in a similar way on both sides. - -```go -rect := &pb.Rectangle{ ... } // initialize a pb.Rectangle -stream, err := client.ListFeatures(context.Background(), rect) -if err != nil { - ... -} -for { - feature, err := stream.Recv() - if err == io.EOF { - break - } - if err != nil { - log.Fatalf("%v.ListFeatures(_) = _, %v", client, err) - } - log.Println(feature) -} -``` - -As in the simple RPC, we pass the method a context and a request. However, instead of getting a response object back, we get back an instance of `RouteGuide_ListFeaturesClient`. The client can use the `RouteGuide_ListFeaturesClient` stream to read the server's responses. - -We use the `RouteGuide_ListFeaturesClient`'s `Recv()` method to repeatedly read in the server's responses to a response protocol buffer object (in this case a `Feature`) until there are no more messages: the client needs to check the error `err` returned from `Recv()` after each call. If `nil`, the stream is still good and it can continue reading; if it's `io.EOF` then the message stream has ended; otherwise there must be an RPC error, which is passed over through `err`. - -#### Client-side streaming RPC - -The client-side streaming method `RecordRoute` is similar to the server-side method, except that we only pass the method a context and get a `RouteGuide_RecordRouteClient` stream back, which we can use to both write *and* read messages. - -```go -// Create a random number of random points -r := rand.New(rand.NewSource(time.Now().UnixNano())) -pointCount := int(r.Int31n(100)) + 2 // Traverse at least two points -var points []*pb.Point -for i := 0; i < pointCount; i++ { - points = append(points, randomPoint(r)) -} -log.Printf("Traversing %d points.", len(points)) -stream, err := client.RecordRoute(context.Background()) -if err != nil { - log.Fatalf("%v.RecordRoute(_) = _, %v", client, err) -} -for _, point := range points { - if err := stream.Send(point); err != nil { - log.Fatalf("%v.Send(%v) = %v", stream, point, err) - } -} -reply, err := stream.CloseAndRecv() -if err != nil { - log.Fatalf("%v.CloseAndRecv() got error %v, want %v", stream, err, nil) -} -log.Printf("Route summary: %v", reply) -``` - -The `RouteGuide_RecordRouteClient` has a `Send()` method that we can use to send requests to the server. Once we've finished writing our client's requests to the stream using `Send()`, we need to call `CloseAndRecv()` on the stream to let gRPC know that we've finished writing and are expecting to receive a response. We get our RPC status from the `err` returned from `CloseAndRecv()`. If the status is `nil`, then the first return value from `CloseAndRecv()` will be a valid server response. - -#### Bidirectional streaming RPC - -Finally, let's look at our bidirectional streaming RPC `RouteChat()`. As in the case of `RecordRoute`, we only pass the method a context object and get back a stream that we can use to both write and read messages. However, this time we return values via our method's stream while the server is still writing messages to *their* message stream. - -```go -stream, err := client.RouteChat(context.Background()) -waitc := make(chan struct{}) -go func() { - for { - in, err := stream.Recv() - if err == io.EOF { - // read done. - close(waitc) - return - } - if err != nil { - log.Fatalf("Failed to receive a note : %v", err) - } - log.Printf("Got message %s at point(%d, %d)", in.Message, in.Location.Latitude, in.Location.Longitude) - } -}() -for _, note := range notes { - if err := stream.Send(note); err != nil { - log.Fatalf("Failed to send a note: %v", err) - } -} -stream.CloseSend() -<-waitc -``` - -The syntax for reading and writing here is very similar to our client-side streaming method, except we use the stream's `CloseSend()` method once we've finished our call. Although each side will always get the other's messages in the order they were written, both the client and server can read and write in any order — the streams operate completely independently. - -## Try it out! - -To compile and run the server, assuming you are in the folder -`$GOPATH/src/google.golang.org/grpc/examples/route_guide`, simply: - -```sh -$ go run server/server.go -``` - -Likewise, to run the client: - -```sh -$ go run client/client.go -``` - diff --git a/vendor/google.golang.org/grpc/examples/helloworld/greeter_client/main.go b/vendor/google.golang.org/grpc/examples/helloworld/greeter_client/main.go deleted file mode 100644 index 1e02ab154da..00000000000 --- a/vendor/google.golang.org/grpc/examples/helloworld/greeter_client/main.go +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * Copyright 2015, 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. - * - */ - -package main - -import ( - "log" - "os" - - pb "google.golang.org/grpc/examples/helloworld/helloworld" - "golang.org/x/net/context" - "google.golang.org/grpc" -) - -const ( - address = "localhost:50051" - defaultName = "world" -) - -func main() { - // Set up a connection to the server. - conn, err := grpc.Dial(address, grpc.WithInsecure()) - if err != nil { - log.Fatalf("did not connect: %v", err) - } - defer conn.Close() - c := pb.NewGreeterClient(conn) - - // Contact the server and print out its response. - name := defaultName - if len(os.Args) > 1 { - name = os.Args[1] - } - r, err := c.SayHello(context.Background(), &pb.HelloRequest{Name: name}) - if err != nil { - log.Fatalf("could not greet: %v", err) - } - log.Printf("Greeting: %s", r.Message) -} diff --git a/vendor/google.golang.org/grpc/examples/helloworld/greeter_server/main.go b/vendor/google.golang.org/grpc/examples/helloworld/greeter_server/main.go deleted file mode 100644 index 66010a51206..00000000000 --- a/vendor/google.golang.org/grpc/examples/helloworld/greeter_server/main.go +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Copyright 2015, 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. - * - */ - -package main - -import ( - "log" - "net" - - pb "google.golang.org/grpc/examples/helloworld/helloworld" - "golang.org/x/net/context" - "google.golang.org/grpc" -) - -const ( - port = ":50051" -) - -// server is used to implement helloworld.GreeterServer. -type server struct{} - -// SayHello implements helloworld.GreeterServer -func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) { - return &pb.HelloReply{Message: "Hello " + in.Name}, nil -} - -func main() { - lis, err := net.Listen("tcp", port) - if err != nil { - log.Fatalf("failed to listen: %v", err) - } - s := grpc.NewServer() - pb.RegisterGreeterServer(s, &server{}) - s.Serve(lis) -} diff --git a/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go b/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go deleted file mode 100644 index 97df8568801..00000000000 --- a/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.pb.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by protoc-gen-go. -// source: helloworld.proto -// DO NOT EDIT! - -/* -Package helloworld is a generated protocol buffer package. - -It is generated from these files: - helloworld.proto - -It has these top-level messages: - HelloRequest - HelloReply -*/ -package helloworld - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -// The request message containing the user's name. -type HelloRequest struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *HelloRequest) Reset() { *m = HelloRequest{} } -func (m *HelloRequest) String() string { return proto.CompactTextString(m) } -func (*HelloRequest) ProtoMessage() {} -func (*HelloRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -// The response message containing the greetings -type HelloReply struct { - Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` -} - -func (m *HelloReply) Reset() { *m = HelloReply{} } -func (m *HelloReply) String() string { return proto.CompactTextString(m) } -func (*HelloReply) ProtoMessage() {} -func (*HelloReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func init() { - proto.RegisterType((*HelloRequest)(nil), "helloworld.HelloRequest") - proto.RegisterType((*HelloReply)(nil), "helloworld.HelloReply") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// Client API for Greeter service - -type GreeterClient interface { - // Sends a greeting - SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) -} - -type greeterClient struct { - cc *grpc.ClientConn -} - -func NewGreeterClient(cc *grpc.ClientConn) GreeterClient { - return &greeterClient{cc} -} - -func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) { - out := new(HelloReply) - err := grpc.Invoke(ctx, "/helloworld.Greeter/SayHello", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Greeter service - -type GreeterServer interface { - // Sends a greeting - SayHello(context.Context, *HelloRequest) (*HelloReply, error) -} - -func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) { - s.RegisterService(&_Greeter_serviceDesc, srv) -} - -func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { - in := new(HelloRequest) - if err := dec(in); err != nil { - return nil, err - } - out, err := srv.(GreeterServer).SayHello(ctx, in) - if err != nil { - return nil, err - } - return out, nil -} - -var _Greeter_serviceDesc = grpc.ServiceDesc{ - ServiceName: "helloworld.Greeter", - HandlerType: (*GreeterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SayHello", - Handler: _Greeter_SayHello_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, -} - -var fileDescriptor0 = []byte{ - // 181 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0x48, 0xcd, 0xc9, - 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x42, 0x88, - 0x28, 0x29, 0x71, 0xf1, 0x78, 0x80, 0x78, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x42, 0x42, - 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x60, 0xb6, 0x92, - 0x1a, 0x17, 0x17, 0x54, 0x4d, 0x41, 0x4e, 0xa5, 0x90, 0x04, 0x17, 0x7b, 0x6e, 0x6a, 0x71, 0x71, - 0x62, 0x3a, 0x4c, 0x11, 0x8c, 0x6b, 0xe4, 0xc9, 0xc5, 0xee, 0x5e, 0x94, 0x9a, 0x5a, 0x92, 0x5a, - 0x24, 0x64, 0xc7, 0xc5, 0x11, 0x9c, 0x58, 0x09, 0xd6, 0x25, 0x24, 0xa1, 0x87, 0xe4, 0x02, 0x64, - 0xcb, 0xa4, 0xc4, 0xb0, 0xc8, 0x00, 0xad, 0x50, 0x62, 0x70, 0x32, 0xe3, 0x92, 0xce, 0xcc, 0xd7, - 0x4b, 0x2f, 0x2a, 0x48, 0xd6, 0x4b, 0xad, 0x48, 0xcc, 0x2d, 0xc8, 0x49, 0x2d, 0x46, 0x52, 0xeb, - 0xc4, 0x0f, 0x56, 0x1c, 0x0e, 0x62, 0x07, 0x80, 0xbc, 0x14, 0xc0, 0xb8, 0x88, 0x89, 0xd9, 0xc3, - 0x27, 0x3c, 0x89, 0x0d, 0xec, 0x43, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x0a, 0xdc, - 0xe8, 0xf5, 0x00, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto b/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto deleted file mode 100644 index 0bee1fcfcfb..00000000000 --- a/vendor/google.golang.org/grpc/examples/helloworld/helloworld/helloworld.proto +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2015, 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. - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "io.grpc.examples.helloworld"; -option java_outer_classname = "HelloWorldProto"; -option objc_class_prefix = "HLW"; - -package helloworld; - -// The greeting service definition. -service Greeter { - // Sends a greeting - rpc SayHello (HelloRequest) returns (HelloReply) {} -} - -// The request message containing the user's name. -message HelloRequest { - string name = 1; -} - -// The response message containing the greetings -message HelloReply { - string message = 1; -} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/README.md b/vendor/google.golang.org/grpc/examples/route_guide/README.md deleted file mode 100644 index a7c0c2b0e53..00000000000 --- a/vendor/google.golang.org/grpc/examples/route_guide/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Description -The route guide server and client demonstrate how to use grpc go libraries to -perform unary, client streaming, server streaming and full duplex RPCs. - -Please refer to [gRPC Basics: Go] (http://www.grpc.io/docs/tutorials/basic/go.html) for more information. - -See the definition of the route guide service in proto/route_guide.proto. - -# Run the sample code -To compile and run the server, assuming you are in the root of the route_guide -folder, i.e., .../examples/route_guide/, simply: - -```sh -$ go run server/server.go -``` - -Likewise, to run the client: - -```sh -$ go run client/client.go -``` - -# Optional command line flags -The server and client both take optional command line flags. For example, the -client and server run without TLS by default. To enable TLS: - -```sh -$ go run server/server.go -tls=true -``` - -and - -```sh -$ go run client/client.go -tls=true -``` diff --git a/vendor/google.golang.org/grpc/examples/route_guide/client/client.go b/vendor/google.golang.org/grpc/examples/route_guide/client/client.go deleted file mode 100644 index a96c0302ced..00000000000 --- a/vendor/google.golang.org/grpc/examples/route_guide/client/client.go +++ /dev/null @@ -1,202 +0,0 @@ -/* - * - * Copyright 2015, 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. - * - */ - -// Package main implements a simple gRPC client that demonstrates how to use gRPC-Go libraries -// to perform unary, client streaming, server streaming and full duplex RPCs. -// -// It interacts with the route guide service whose definition can be found in proto/route_guide.proto. -package main - -import ( - "flag" - "io" - "math/rand" - "time" - - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - pb "google.golang.org/grpc/examples/route_guide/routeguide" - "google.golang.org/grpc/grpclog" -) - -var ( - tls = flag.Bool("tls", false, "Connection uses TLS if true, else plain TCP") - caFile = flag.String("ca_file", "testdata/ca.pem", "The file containning the CA root cert file") - serverAddr = flag.String("server_addr", "127.0.0.1:10000", "The server address in the format of host:port") - serverHostOverride = flag.String("server_host_override", "x.test.youtube.com", "The server name use to verify the hostname returned by TLS handshake") -) - -// printFeature gets the feature for the given point. -func printFeature(client pb.RouteGuideClient, point *pb.Point) { - grpclog.Printf("Getting feature for point (%d, %d)", point.Latitude, point.Longitude) - feature, err := client.GetFeature(context.Background(), point) - if err != nil { - grpclog.Fatalf("%v.GetFeatures(_) = _, %v: ", client, err) - } - grpclog.Println(feature) -} - -// printFeatures lists all the features within the given bounding Rectangle. -func printFeatures(client pb.RouteGuideClient, rect *pb.Rectangle) { - grpclog.Printf("Looking for features within %v", rect) - stream, err := client.ListFeatures(context.Background(), rect) - if err != nil { - grpclog.Fatalf("%v.ListFeatures(_) = _, %v", client, err) - } - for { - feature, err := stream.Recv() - if err == io.EOF { - break - } - if err != nil { - grpclog.Fatalf("%v.ListFeatures(_) = _, %v", client, err) - } - grpclog.Println(feature) - } -} - -// runRecordRoute sends a sequence of points to server and expects to get a RouteSummary from server. -func runRecordRoute(client pb.RouteGuideClient) { - // Create a random number of random points - r := rand.New(rand.NewSource(time.Now().UnixNano())) - pointCount := int(r.Int31n(100)) + 2 // Traverse at least two points - var points []*pb.Point - for i := 0; i < pointCount; i++ { - points = append(points, randomPoint(r)) - } - grpclog.Printf("Traversing %d points.", len(points)) - stream, err := client.RecordRoute(context.Background()) - if err != nil { - grpclog.Fatalf("%v.RecordRoute(_) = _, %v", client, err) - } - for _, point := range points { - if err := stream.Send(point); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, point, err) - } - } - reply, err := stream.CloseAndRecv() - if err != nil { - grpclog.Fatalf("%v.CloseAndRecv() got error %v, want %v", stream, err, nil) - } - grpclog.Printf("Route summary: %v", reply) -} - -// runRouteChat receives a sequence of route notes, while sending notes for various locations. -func runRouteChat(client pb.RouteGuideClient) { - notes := []*pb.RouteNote{ - {&pb.Point{0, 1}, "First message"}, - {&pb.Point{0, 2}, "Second message"}, - {&pb.Point{0, 3}, "Third message"}, - {&pb.Point{0, 1}, "Fourth message"}, - {&pb.Point{0, 2}, "Fifth message"}, - {&pb.Point{0, 3}, "Sixth message"}, - } - stream, err := client.RouteChat(context.Background()) - if err != nil { - grpclog.Fatalf("%v.RouteChat(_) = _, %v", client, err) - } - waitc := make(chan struct{}) - go func() { - for { - in, err := stream.Recv() - if err == io.EOF { - // read done. - close(waitc) - return - } - if err != nil { - grpclog.Fatalf("Failed to receive a note : %v", err) - } - grpclog.Printf("Got message %s at point(%d, %d)", in.Message, in.Location.Latitude, in.Location.Longitude) - } - }() - for _, note := range notes { - if err := stream.Send(note); err != nil { - grpclog.Fatalf("Failed to send a note: %v", err) - } - } - stream.CloseSend() - <-waitc -} - -func randomPoint(r *rand.Rand) *pb.Point { - lat := (r.Int31n(180) - 90) * 1e7 - long := (r.Int31n(360) - 180) * 1e7 - return &pb.Point{lat, long} -} - -func main() { - flag.Parse() - var opts []grpc.DialOption - if *tls { - var sn string - if *serverHostOverride != "" { - sn = *serverHostOverride - } - var creds credentials.TransportAuthenticator - if *caFile != "" { - var err error - creds, err = credentials.NewClientTLSFromFile(*caFile, sn) - if err != nil { - grpclog.Fatalf("Failed to create TLS credentials %v", err) - } - } else { - creds = credentials.NewClientTLSFromCert(nil, sn) - } - opts = append(opts, grpc.WithTransportCredentials(creds)) - } else { - opts = append(opts, grpc.WithInsecure()) - } - conn, err := grpc.Dial(*serverAddr, opts...) - if err != nil { - grpclog.Fatalf("fail to dial: %v", err) - } - defer conn.Close() - client := pb.NewRouteGuideClient(conn) - - // Looking for a valid feature - printFeature(client, &pb.Point{409146138, -746188906}) - - // Feature missing. - printFeature(client, &pb.Point{0, 0}) - - // Looking for features between 40, -75 and 42, -73. - printFeatures(client, &pb.Rectangle{&pb.Point{400000000, -750000000}, &pb.Point{420000000, -730000000}}) - - // RecordRoute - runRecordRoute(client) - - // RouteChat - runRouteChat(client) -} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go b/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go deleted file mode 100644 index 4f5f5c13d03..00000000000 --- a/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.pb.go +++ /dev/null @@ -1,473 +0,0 @@ -// Code generated by protoc-gen-go. -// source: route_guide.proto -// DO NOT EDIT! - -/* -Package routeguide is a generated protocol buffer package. - -It is generated from these files: - route_guide.proto - -It has these top-level messages: - Point - Rectangle - Feature - RouteNote - RouteSummary -*/ -package routeguide - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -// Points are represented as latitude-longitude pairs in the E7 representation -// (degrees multiplied by 10**7 and rounded to the nearest integer). -// Latitudes should be in the range +/- 90 degrees and longitude should be in -// the range +/- 180 degrees (inclusive). -type Point struct { - Latitude int32 `protobuf:"varint,1,opt,name=latitude" json:"latitude,omitempty"` - Longitude int32 `protobuf:"varint,2,opt,name=longitude" json:"longitude,omitempty"` -} - -func (m *Point) Reset() { *m = Point{} } -func (m *Point) String() string { return proto.CompactTextString(m) } -func (*Point) ProtoMessage() {} -func (*Point) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -// A latitude-longitude rectangle, represented as two diagonally opposite -// points "lo" and "hi". -type Rectangle struct { - // One corner of the rectangle. - Lo *Point `protobuf:"bytes,1,opt,name=lo" json:"lo,omitempty"` - // The other corner of the rectangle. - Hi *Point `protobuf:"bytes,2,opt,name=hi" json:"hi,omitempty"` -} - -func (m *Rectangle) Reset() { *m = Rectangle{} } -func (m *Rectangle) String() string { return proto.CompactTextString(m) } -func (*Rectangle) ProtoMessage() {} -func (*Rectangle) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Rectangle) GetLo() *Point { - if m != nil { - return m.Lo - } - return nil -} - -func (m *Rectangle) GetHi() *Point { - if m != nil { - return m.Hi - } - return nil -} - -// A feature names something at a given point. -// -// If a feature could not be named, the name is empty. -type Feature struct { - // The name of the feature. - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // The point where the feature is detected. - Location *Point `protobuf:"bytes,2,opt,name=location" json:"location,omitempty"` -} - -func (m *Feature) Reset() { *m = Feature{} } -func (m *Feature) String() string { return proto.CompactTextString(m) } -func (*Feature) ProtoMessage() {} -func (*Feature) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -func (m *Feature) GetLocation() *Point { - if m != nil { - return m.Location - } - return nil -} - -// A RouteNote is a message sent while at a given point. -type RouteNote struct { - // The location from which the message is sent. - Location *Point `protobuf:"bytes,1,opt,name=location" json:"location,omitempty"` - // The message to be sent. - Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` -} - -func (m *RouteNote) Reset() { *m = RouteNote{} } -func (m *RouteNote) String() string { return proto.CompactTextString(m) } -func (*RouteNote) ProtoMessage() {} -func (*RouteNote) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *RouteNote) GetLocation() *Point { - if m != nil { - return m.Location - } - return nil -} - -// A RouteSummary is received in response to a RecordRoute rpc. -// -// It contains the number of individual points received, the number of -// detected features, and the total distance covered as the cumulative sum of -// the distance between each point. -type RouteSummary struct { - // The number of points received. - PointCount int32 `protobuf:"varint,1,opt,name=point_count" json:"point_count,omitempty"` - // The number of known features passed while traversing the route. - FeatureCount int32 `protobuf:"varint,2,opt,name=feature_count" json:"feature_count,omitempty"` - // The distance covered in metres. - Distance int32 `protobuf:"varint,3,opt,name=distance" json:"distance,omitempty"` - // The duration of the traversal in seconds. - ElapsedTime int32 `protobuf:"varint,4,opt,name=elapsed_time" json:"elapsed_time,omitempty"` -} - -func (m *RouteSummary) Reset() { *m = RouteSummary{} } -func (m *RouteSummary) String() string { return proto.CompactTextString(m) } -func (*RouteSummary) ProtoMessage() {} -func (*RouteSummary) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -func init() { - proto.RegisterType((*Point)(nil), "routeguide.Point") - proto.RegisterType((*Rectangle)(nil), "routeguide.Rectangle") - proto.RegisterType((*Feature)(nil), "routeguide.Feature") - proto.RegisterType((*RouteNote)(nil), "routeguide.RouteNote") - proto.RegisterType((*RouteSummary)(nil), "routeguide.RouteSummary") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// Client API for RouteGuide service - -type RouteGuideClient interface { - // A simple RPC. - // - // Obtains the feature at a given position. - // - // A feature with an empty name is returned if there's no feature at the given - // position. - GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) - // A server-to-client streaming RPC. - // - // Obtains the Features available within the given Rectangle. Results are - // streamed rather than returned at once (e.g. in a response message with a - // repeated field), as the rectangle may cover a large area and contain a - // huge number of features. - ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) - // A client-to-server streaming RPC. - // - // Accepts a stream of Points on a route being traversed, returning a - // RouteSummary when traversal is completed. - RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) - // A Bidirectional streaming RPC. - // - // Accepts a stream of RouteNotes sent while a route is being traversed, - // while receiving other RouteNotes (e.g. from other users). - RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) -} - -type routeGuideClient struct { - cc *grpc.ClientConn -} - -func NewRouteGuideClient(cc *grpc.ClientConn) RouteGuideClient { - return &routeGuideClient{cc} -} - -func (c *routeGuideClient) GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error) { - out := new(Feature) - err := grpc.Invoke(ctx, "/routeguide.RouteGuide/GetFeature", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routeGuideClient) ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error) { - stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[0], c.cc, "/routeguide.RouteGuide/ListFeatures", opts...) - if err != nil { - return nil, err - } - x := &routeGuideListFeaturesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type RouteGuide_ListFeaturesClient interface { - Recv() (*Feature, error) - grpc.ClientStream -} - -type routeGuideListFeaturesClient struct { - grpc.ClientStream -} - -func (x *routeGuideListFeaturesClient) Recv() (*Feature, error) { - m := new(Feature) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *routeGuideClient) RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error) { - stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[1], c.cc, "/routeguide.RouteGuide/RecordRoute", opts...) - if err != nil { - return nil, err - } - x := &routeGuideRecordRouteClient{stream} - return x, nil -} - -type RouteGuide_RecordRouteClient interface { - Send(*Point) error - CloseAndRecv() (*RouteSummary, error) - grpc.ClientStream -} - -type routeGuideRecordRouteClient struct { - grpc.ClientStream -} - -func (x *routeGuideRecordRouteClient) Send(m *Point) error { - return x.ClientStream.SendMsg(m) -} - -func (x *routeGuideRecordRouteClient) CloseAndRecv() (*RouteSummary, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(RouteSummary) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *routeGuideClient) RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error) { - stream, err := grpc.NewClientStream(ctx, &_RouteGuide_serviceDesc.Streams[2], c.cc, "/routeguide.RouteGuide/RouteChat", opts...) - if err != nil { - return nil, err - } - x := &routeGuideRouteChatClient{stream} - return x, nil -} - -type RouteGuide_RouteChatClient interface { - Send(*RouteNote) error - Recv() (*RouteNote, error) - grpc.ClientStream -} - -type routeGuideRouteChatClient struct { - grpc.ClientStream -} - -func (x *routeGuideRouteChatClient) Send(m *RouteNote) error { - return x.ClientStream.SendMsg(m) -} - -func (x *routeGuideRouteChatClient) Recv() (*RouteNote, error) { - m := new(RouteNote) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Server API for RouteGuide service - -type RouteGuideServer interface { - // A simple RPC. - // - // Obtains the feature at a given position. - // - // A feature with an empty name is returned if there's no feature at the given - // position. - GetFeature(context.Context, *Point) (*Feature, error) - // A server-to-client streaming RPC. - // - // Obtains the Features available within the given Rectangle. Results are - // streamed rather than returned at once (e.g. in a response message with a - // repeated field), as the rectangle may cover a large area and contain a - // huge number of features. - ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error - // A client-to-server streaming RPC. - // - // Accepts a stream of Points on a route being traversed, returning a - // RouteSummary when traversal is completed. - RecordRoute(RouteGuide_RecordRouteServer) error - // A Bidirectional streaming RPC. - // - // Accepts a stream of RouteNotes sent while a route is being traversed, - // while receiving other RouteNotes (e.g. from other users). - RouteChat(RouteGuide_RouteChatServer) error -} - -func RegisterRouteGuideServer(s *grpc.Server, srv RouteGuideServer) { - s.RegisterService(&_RouteGuide_serviceDesc, srv) -} - -func _RouteGuide_GetFeature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { - in := new(Point) - if err := dec(in); err != nil { - return nil, err - } - out, err := srv.(RouteGuideServer).GetFeature(ctx, in) - if err != nil { - return nil, err - } - return out, nil -} - -func _RouteGuide_ListFeatures_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(Rectangle) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(RouteGuideServer).ListFeatures(m, &routeGuideListFeaturesServer{stream}) -} - -type RouteGuide_ListFeaturesServer interface { - Send(*Feature) error - grpc.ServerStream -} - -type routeGuideListFeaturesServer struct { - grpc.ServerStream -} - -func (x *routeGuideListFeaturesServer) Send(m *Feature) error { - return x.ServerStream.SendMsg(m) -} - -func _RouteGuide_RecordRoute_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(RouteGuideServer).RecordRoute(&routeGuideRecordRouteServer{stream}) -} - -type RouteGuide_RecordRouteServer interface { - SendAndClose(*RouteSummary) error - Recv() (*Point, error) - grpc.ServerStream -} - -type routeGuideRecordRouteServer struct { - grpc.ServerStream -} - -func (x *routeGuideRecordRouteServer) SendAndClose(m *RouteSummary) error { - return x.ServerStream.SendMsg(m) -} - -func (x *routeGuideRecordRouteServer) Recv() (*Point, error) { - m := new(Point) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _RouteGuide_RouteChat_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(RouteGuideServer).RouteChat(&routeGuideRouteChatServer{stream}) -} - -type RouteGuide_RouteChatServer interface { - Send(*RouteNote) error - Recv() (*RouteNote, error) - grpc.ServerStream -} - -type routeGuideRouteChatServer struct { - grpc.ServerStream -} - -func (x *routeGuideRouteChatServer) Send(m *RouteNote) error { - return x.ServerStream.SendMsg(m) -} - -func (x *routeGuideRouteChatServer) Recv() (*RouteNote, error) { - m := new(RouteNote) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _RouteGuide_serviceDesc = grpc.ServiceDesc{ - ServiceName: "routeguide.RouteGuide", - HandlerType: (*RouteGuideServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetFeature", - Handler: _RouteGuide_GetFeature_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "ListFeatures", - Handler: _RouteGuide_ListFeatures_Handler, - ServerStreams: true, - }, - { - StreamName: "RecordRoute", - Handler: _RouteGuide_RecordRoute_Handler, - ClientStreams: true, - }, - { - StreamName: "RouteChat", - Handler: _RouteGuide_RouteChat_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, -} - -var fileDescriptor0 = []byte{ - // 412 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x53, 0xd1, 0x6a, 0xa3, 0x40, - 0x14, 0xcd, 0x98, 0x64, 0xb3, 0x5e, 0x5d, 0x96, 0xcc, 0xb2, 0x20, 0xd9, 0x85, 0xb6, 0xf6, 0x25, - 0x2f, 0x95, 0x90, 0x42, 0x1e, 0x5b, 0x9a, 0x40, 0xf3, 0x12, 0x4a, 0x6a, 0xf3, 0x1e, 0xa6, 0x3a, - 0x35, 0x03, 0xea, 0x88, 0x8e, 0xd0, 0x7e, 0x40, 0xbf, 0xa0, 0x7f, 0xd0, 0x2f, 0xed, 0x38, 0x6a, - 0x62, 0xda, 0x84, 0xbe, 0x39, 0xe7, 0x9e, 0x73, 0xef, 0xb9, 0xe7, 0x22, 0xf4, 0x53, 0x9e, 0x0b, - 0xba, 0x0e, 0x72, 0xe6, 0x53, 0x27, 0x49, 0xb9, 0xe0, 0x18, 0x14, 0xa4, 0x10, 0xfb, 0x06, 0xba, - 0x4b, 0xce, 0x62, 0x81, 0x07, 0xf0, 0x33, 0x24, 0x82, 0x89, 0xdc, 0xa7, 0x16, 0x3a, 0x45, 0xc3, - 0xae, 0xbb, 0x7d, 0xe3, 0xff, 0xa0, 0x87, 0x3c, 0x0e, 0xca, 0xa2, 0xa6, 0x8a, 0x3b, 0xc0, 0xbe, - 0x07, 0xdd, 0xa5, 0x9e, 0x20, 0x71, 0x10, 0x52, 0x7c, 0x06, 0x5a, 0xc8, 0x55, 0x03, 0x63, 0xdc, - 0x77, 0x76, 0x83, 0x1c, 0x35, 0xc5, 0x95, 0xc5, 0x82, 0xb2, 0x61, 0xaa, 0xcd, 0x61, 0xca, 0x86, - 0xd9, 0x0b, 0xe8, 0xdd, 0x52, 0x22, 0xf2, 0x94, 0x62, 0x0c, 0x9d, 0x98, 0x44, 0xa5, 0x27, 0xdd, - 0x55, 0xdf, 0xf8, 0x42, 0x7a, 0xe5, 0x9e, 0x74, 0xc7, 0xe3, 0xe3, 0x7d, 0xb6, 0x14, 0x7b, 0x25, - 0x0d, 0x16, 0xd5, 0x3b, 0x2e, 0xf6, 0xb5, 0xe8, 0x5b, 0x2d, 0xb6, 0xa0, 0x17, 0xd1, 0x2c, 0x23, - 0x41, 0xb9, 0xb8, 0xee, 0xd6, 0x4f, 0xfb, 0x0d, 0x81, 0xa9, 0xda, 0x3e, 0xe4, 0x51, 0x44, 0xd2, - 0x17, 0x7c, 0x02, 0x46, 0x52, 0xa8, 0xd7, 0x1e, 0xcf, 0x63, 0x51, 0x85, 0x08, 0x0a, 0x9a, 0x15, - 0x08, 0x3e, 0x87, 0x5f, 0x4f, 0xe5, 0x56, 0x15, 0xa5, 0x8c, 0xd2, 0xac, 0xc0, 0x92, 0x24, 0xef, - 0xe0, 0xb3, 0x4c, 0xa6, 0xe9, 0x51, 0xab, 0x5d, 0xde, 0xa1, 0x7e, 0xcb, 0xe4, 0x4c, 0x1a, 0x92, - 0x24, 0xa3, 0xfe, 0x5a, 0x30, 0x99, 0x49, 0x47, 0xd5, 0x8d, 0x0a, 0x5b, 0x49, 0x68, 0xfc, 0xaa, - 0x01, 0x28, 0x57, 0xf3, 0x62, 0x1d, 0x3c, 0x01, 0x98, 0x53, 0x51, 0x67, 0xf9, 0x75, 0xd3, 0xc1, - 0x9f, 0x26, 0x54, 0xf1, 0xec, 0x16, 0xbe, 0x02, 0x73, 0x21, 0xa7, 0x56, 0x40, 0x86, 0xff, 0x36, - 0x69, 0xdb, 0x6b, 0x1f, 0x51, 0x8f, 0x90, 0xd4, 0x1b, 0x92, 0xc5, 0x53, 0x5f, 0x79, 0x39, 0x34, - 0xd8, 0xda, 0xeb, 0xd8, 0xc8, 0xd1, 0x6e, 0x0d, 0x11, 0xbe, 0xae, 0x4e, 0x36, 0xdb, 0x10, 0xf1, - 0x69, 0x78, 0x7d, 0xc9, 0xc1, 0x61, 0xb8, 0x90, 0x8f, 0xd0, 0x74, 0x02, 0xff, 0x18, 0x77, 0x82, - 0x34, 0xf1, 0x1c, 0xfa, 0x4c, 0xa2, 0x24, 0xa4, 0x59, 0x83, 0x3e, 0xfd, 0xbd, 0xcb, 0x68, 0x59, - 0xfc, 0x13, 0x4b, 0xf4, 0xae, 0xb5, 0xdd, 0xd5, 0xfc, 0xf1, 0x87, 0xfa, 0x45, 0x2e, 0x3f, 0x02, - 0x00, 0x00, 0xff, 0xff, 0xf3, 0xe2, 0x76, 0x5e, 0x37, 0x03, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto b/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto deleted file mode 100644 index 12c4495ffab..00000000000 --- a/vendor/google.golang.org/grpc/examples/route_guide/routeguide/route_guide.proto +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2015, 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. - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "io.grpc.examples.routeguide"; -option java_outer_classname = "RouteGuideProto"; -option objc_class_prefix = "RTG"; - -package routeguide; - -// Interface exported by the server. -service RouteGuide { - // A simple RPC. - // - // Obtains the feature at a given position. - // - // A feature with an empty name is returned if there's no feature at the given - // position. - rpc GetFeature(Point) returns (Feature) {} - - // A server-to-client streaming RPC. - // - // Obtains the Features available within the given Rectangle. Results are - // streamed rather than returned at once (e.g. in a response message with a - // repeated field), as the rectangle may cover a large area and contain a - // huge number of features. - rpc ListFeatures(Rectangle) returns (stream Feature) {} - - // A client-to-server streaming RPC. - // - // Accepts a stream of Points on a route being traversed, returning a - // RouteSummary when traversal is completed. - rpc RecordRoute(stream Point) returns (RouteSummary) {} - - // A Bidirectional streaming RPC. - // - // Accepts a stream of RouteNotes sent while a route is being traversed, - // while receiving other RouteNotes (e.g. from other users). - rpc RouteChat(stream RouteNote) returns (stream RouteNote) {} -} - -// Points are represented as latitude-longitude pairs in the E7 representation -// (degrees multiplied by 10**7 and rounded to the nearest integer). -// Latitudes should be in the range +/- 90 degrees and longitude should be in -// the range +/- 180 degrees (inclusive). -message Point { - int32 latitude = 1; - int32 longitude = 2; -} - -// A latitude-longitude rectangle, represented as two diagonally opposite -// points "lo" and "hi". -message Rectangle { - // One corner of the rectangle. - Point lo = 1; - - // The other corner of the rectangle. - Point hi = 2; -} - -// A feature names something at a given point. -// -// If a feature could not be named, the name is empty. -message Feature { - // The name of the feature. - string name = 1; - - // The point where the feature is detected. - Point location = 2; -} - -// A RouteNote is a message sent while at a given point. -message RouteNote { - // The location from which the message is sent. - Point location = 1; - - // The message to be sent. - string message = 2; -} - -// A RouteSummary is received in response to a RecordRoute rpc. -// -// It contains the number of individual points received, the number of -// detected features, and the total distance covered as the cumulative sum of -// the distance between each point. -message RouteSummary { - // The number of points received. - int32 point_count = 1; - - // The number of known features passed while traversing the route. - int32 feature_count = 2; - - // The distance covered in metres. - int32 distance = 3; - - // The duration of the traversal in seconds. - int32 elapsed_time = 4; -} diff --git a/vendor/google.golang.org/grpc/examples/route_guide/server/server.go b/vendor/google.golang.org/grpc/examples/route_guide/server/server.go deleted file mode 100644 index 09b3942d191..00000000000 --- a/vendor/google.golang.org/grpc/examples/route_guide/server/server.go +++ /dev/null @@ -1,239 +0,0 @@ -/* - * - * Copyright 2015, 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. - * - */ - -// Package main implements a simple gRPC server that demonstrates how to use gRPC-Go libraries -// to perform unary, client streaming, server streaming and full duplex RPCs. -// -// It implements the route guide service whose definition can be found in proto/route_guide.proto. -package main - -import ( - "encoding/json" - "flag" - "fmt" - "io" - "io/ioutil" - "math" - "net" - "time" - - "golang.org/x/net/context" - "google.golang.org/grpc" - - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/grpclog" - - "github.com/golang/protobuf/proto" - - pb "google.golang.org/grpc/examples/route_guide/routeguide" -) - -var ( - tls = flag.Bool("tls", false, "Connection uses TLS if true, else plain TCP") - certFile = flag.String("cert_file", "testdata/server1.pem", "The TLS cert file") - keyFile = flag.String("key_file", "testdata/server1.key", "The TLS key file") - jsonDBFile = flag.String("json_db_file", "testdata/route_guide_db.json", "A json file containing a list of features") - port = flag.Int("port", 10000, "The server port") -) - -type routeGuideServer struct { - savedFeatures []*pb.Feature - routeNotes map[string][]*pb.RouteNote -} - -// GetFeature returns the feature at the given point. -func (s *routeGuideServer) GetFeature(ctx context.Context, point *pb.Point) (*pb.Feature, error) { - for _, feature := range s.savedFeatures { - if proto.Equal(feature.Location, point) { - return feature, nil - } - } - // No feature was found, return an unnamed feature - return &pb.Feature{"", point}, nil -} - -// ListFeatures lists all features comtained within the given bounding Rectangle. -func (s *routeGuideServer) ListFeatures(rect *pb.Rectangle, stream pb.RouteGuide_ListFeaturesServer) error { - for _, feature := range s.savedFeatures { - if inRange(feature.Location, rect) { - if err := stream.Send(feature); err != nil { - return err - } - } - } - return nil -} - -// RecordRoute records a route composited of a sequence of points. -// -// It gets a stream of points, and responds with statistics about the "trip": -// number of points, number of known features visited, total distance traveled, and -// total time spent. -func (s *routeGuideServer) RecordRoute(stream pb.RouteGuide_RecordRouteServer) error { - var pointCount, featureCount, distance int32 - var lastPoint *pb.Point - startTime := time.Now() - for { - point, err := stream.Recv() - if err == io.EOF { - endTime := time.Now() - return stream.SendAndClose(&pb.RouteSummary{ - PointCount: pointCount, - FeatureCount: featureCount, - Distance: distance, - ElapsedTime: int32(endTime.Sub(startTime).Seconds()), - }) - } - if err != nil { - return err - } - pointCount++ - for _, feature := range s.savedFeatures { - if proto.Equal(feature.Location, point) { - featureCount++ - } - } - if lastPoint != nil { - distance += calcDistance(lastPoint, point) - } - lastPoint = point - } -} - -// RouteChat receives a stream of message/location pairs, and responds with a stream of all -// previous messages at each of those locations. -func (s *routeGuideServer) RouteChat(stream pb.RouteGuide_RouteChatServer) error { - for { - in, err := stream.Recv() - if err == io.EOF { - return nil - } - if err != nil { - return err - } - key := serialize(in.Location) - if _, present := s.routeNotes[key]; !present { - s.routeNotes[key] = []*pb.RouteNote{in} - } else { - s.routeNotes[key] = append(s.routeNotes[key], in) - } - for _, note := range s.routeNotes[key] { - if err := stream.Send(note); err != nil { - return err - } - } - } -} - -// loadFeatures loads features from a JSON file. -func (s *routeGuideServer) loadFeatures(filePath string) { - file, err := ioutil.ReadFile(filePath) - if err != nil { - grpclog.Fatalf("Failed to load default features: %v", err) - } - if err := json.Unmarshal(file, &s.savedFeatures); err != nil { - grpclog.Fatalf("Failed to load default features: %v", err) - } -} - -func toRadians(num float64) float64 { - return num * math.Pi / float64(180) -} - -// calcDistance calculates the distance between two points using the "haversine" formula. -// This code was taken from http://www.movable-type.co.uk/scripts/latlong.html. -func calcDistance(p1 *pb.Point, p2 *pb.Point) int32 { - const CordFactor float64 = 1e7 - const R float64 = float64(6371000) // metres - lat1 := float64(p1.Latitude) / CordFactor - lat2 := float64(p2.Latitude) / CordFactor - lng1 := float64(p1.Longitude) / CordFactor - lng2 := float64(p2.Longitude) / CordFactor - φ1 := toRadians(lat1) - φ2 := toRadians(lat2) - Δφ := toRadians(lat2 - lat1) - Δλ := toRadians(lng2 - lng1) - - a := math.Sin(Δφ/2)*math.Sin(Δφ/2) + - math.Cos(φ1)*math.Cos(φ2)* - math.Sin(Δλ/2)*math.Sin(Δλ/2) - c := 2 * math.Atan2(math.Sqrt(a), math.Sqrt(1-a)) - - distance := R * c - return int32(distance) -} - -func inRange(point *pb.Point, rect *pb.Rectangle) bool { - left := math.Min(float64(rect.Lo.Longitude), float64(rect.Hi.Longitude)) - right := math.Max(float64(rect.Lo.Longitude), float64(rect.Hi.Longitude)) - top := math.Max(float64(rect.Lo.Latitude), float64(rect.Hi.Latitude)) - bottom := math.Min(float64(rect.Lo.Latitude), float64(rect.Hi.Latitude)) - - if float64(point.Longitude) >= left && - float64(point.Longitude) <= right && - float64(point.Latitude) >= bottom && - float64(point.Latitude) <= top { - return true - } - return false -} - -func serialize(point *pb.Point) string { - return fmt.Sprintf("%d %d", point.Latitude, point.Longitude) -} - -func newServer() *routeGuideServer { - s := new(routeGuideServer) - s.loadFeatures(*jsonDBFile) - s.routeNotes = make(map[string][]*pb.RouteNote) - return s -} - -func main() { - flag.Parse() - lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *port)) - if err != nil { - grpclog.Fatalf("failed to listen: %v", err) - } - var opts []grpc.ServerOption - if *tls { - creds, err := credentials.NewServerTLSFromFile(*certFile, *keyFile) - if err != nil { - grpclog.Fatalf("Failed to generate credentials %v", err) - } - opts = []grpc.ServerOption{grpc.Creds(creds)} - } - grpcServer := grpc.NewServer(opts...) - pb.RegisterRouteGuideServer(grpcServer, newServer()) - grpcServer.Serve(lis) -} diff --git a/vendor/google.golang.org/grpc/grpclog/glogger/glogger.go b/vendor/google.golang.org/grpc/grpclog/glogger/glogger.go deleted file mode 100644 index 53e3c539fb0..00000000000 --- a/vendor/google.golang.org/grpc/grpclog/glogger/glogger.go +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * Copyright 2015, 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. - * - */ - -/* -Package glogger defines glog-based logging for grpc. -*/ -package glogger - -import ( - "github.com/golang/glog" - "google.golang.org/grpc/grpclog" -) - -func init() { - grpclog.SetLogger(&glogger{}) -} - -type glogger struct{} - -func (g *glogger) Fatal(args ...interface{}) { - glog.Fatal(args...) -} - -func (g *glogger) Fatalf(format string, args ...interface{}) { - glog.Fatalf(format, args...) -} - -func (g *glogger) Fatalln(args ...interface{}) { - glog.Fatalln(args...) -} - -func (g *glogger) Print(args ...interface{}) { - glog.Info(args...) -} - -func (g *glogger) Printf(format string, args ...interface{}) { - glog.Infof(format, args...) -} - -func (g *glogger) Println(args ...interface{}) { - glog.Infoln(args...) -} diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1alpha/health.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1alpha/health.pb.go deleted file mode 100644 index 8e89dc9f27a..00000000000 --- a/vendor/google.golang.org/grpc/health/grpc_health_v1alpha/health.pb.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by protoc-gen-go. -// source: health.proto -// DO NOT EDIT! - -/* -Package grpc_health_v1alpha is a generated protocol buffer package. - -It is generated from these files: - health.proto - -It has these top-level messages: - HealthCheckRequest - HealthCheckResponse -*/ -package grpc_health_v1alpha - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -type HealthCheckResponse_ServingStatus int32 - -const ( - HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 - HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 - HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 -) - -var HealthCheckResponse_ServingStatus_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SERVING", - 2: "NOT_SERVING", -} -var HealthCheckResponse_ServingStatus_value = map[string]int32{ - "UNKNOWN": 0, - "SERVING": 1, - "NOT_SERVING": 2, -} - -func (x HealthCheckResponse_ServingStatus) String() string { - return proto.EnumName(HealthCheckResponse_ServingStatus_name, int32(x)) -} -func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor0, []int{1, 0} -} - -type HealthCheckRequest struct { - Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"` -} - -func (m *HealthCheckRequest) Reset() { *m = HealthCheckRequest{} } -func (m *HealthCheckRequest) String() string { return proto.CompactTextString(m) } -func (*HealthCheckRequest) ProtoMessage() {} -func (*HealthCheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -type HealthCheckResponse struct { - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,enum=grpc.health.v1alpha.HealthCheckResponse_ServingStatus" json:"status,omitempty"` -} - -func (m *HealthCheckResponse) Reset() { *m = HealthCheckResponse{} } -func (m *HealthCheckResponse) String() string { return proto.CompactTextString(m) } -func (*HealthCheckResponse) ProtoMessage() {} -func (*HealthCheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func init() { - proto.RegisterType((*HealthCheckRequest)(nil), "grpc.health.v1alpha.HealthCheckRequest") - proto.RegisterType((*HealthCheckResponse)(nil), "grpc.health.v1alpha.HealthCheckResponse") - proto.RegisterEnum("grpc.health.v1alpha.HealthCheckResponse_ServingStatus", HealthCheckResponse_ServingStatus_name, HealthCheckResponse_ServingStatus_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// Client API for Health service - -type HealthClient interface { - Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) -} - -type healthClient struct { - cc *grpc.ClientConn -} - -func NewHealthClient(cc *grpc.ClientConn) HealthClient { - return &healthClient{cc} -} - -func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { - out := new(HealthCheckResponse) - err := grpc.Invoke(ctx, "/grpc.health.v1alpha.Health/Check", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Health service - -type HealthServer interface { - Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) -} - -func RegisterHealthServer(s *grpc.Server, srv HealthServer) { - s.RegisterService(&_Health_serviceDesc, srv) -} - -func _Health_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { - in := new(HealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - out, err := srv.(HealthServer).Check(ctx, in) - if err != nil { - return nil, err - } - return out, nil -} - -var _Health_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.health.v1alpha.Health", - HandlerType: (*HealthServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Check", - Handler: _Health_Check_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, -} - -var fileDescriptor0 = []byte{ - // 209 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xc9, 0x48, 0x4d, 0xcc, - 0x29, 0xc9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4e, 0x2f, 0x2a, 0x48, 0xd6, 0x83, - 0x0a, 0x95, 0x19, 0x26, 0xe6, 0x14, 0x64, 0x24, 0x2a, 0xe9, 0x71, 0x09, 0x79, 0x80, 0x45, 0x9c, - 0x33, 0x52, 0x93, 0xb3, 0x83, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x24, 0xb8, 0xd8, 0x8b, - 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0x60, 0x5c, 0xa5, - 0x85, 0x8c, 0x5c, 0xc2, 0x28, 0x1a, 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0xfc, 0xb8, 0xd8, - 0x8a, 0x4b, 0x12, 0x4b, 0x4a, 0x8b, 0xc1, 0x1a, 0xf8, 0x8c, 0xcc, 0xf4, 0xb0, 0xd8, 0xa6, 0x87, - 0x45, 0xa7, 0x5e, 0x30, 0xc8, 0xe4, 0xbc, 0xf4, 0x60, 0xb0, 0xee, 0x20, 0xa8, 0x29, 0x4a, 0x56, - 0x5c, 0xbc, 0x28, 0x12, 0x42, 0xdc, 0x5c, 0xec, 0xa1, 0x7e, 0xde, 0x7e, 0xfe, 0xe1, 0x7e, 0x02, - 0x0c, 0x20, 0x4e, 0xb0, 0x6b, 0x50, 0x98, 0xa7, 0x9f, 0xbb, 0x00, 0xa3, 0x10, 0x3f, 0x17, 0xb7, - 0x9f, 0x7f, 0x48, 0x3c, 0x4c, 0x80, 0xc9, 0x28, 0x85, 0x8b, 0x0d, 0x62, 0x91, 0x50, 0x14, 0x17, - 0x2b, 0xd8, 0x32, 0x21, 0x75, 0xc2, 0xce, 0x01, 0xfb, 0x5c, 0x4a, 0x83, 0x58, 0x77, 0x27, 0xb1, - 0x81, 0x43, 0xd5, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x3f, 0xd0, 0xe1, 0x65, 0x01, 0x00, - 0x00, -} diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1alpha/health.proto b/vendor/google.golang.org/grpc/health/grpc_health_v1alpha/health.proto deleted file mode 100644 index 91c7f06e9b2..00000000000 --- a/vendor/google.golang.org/grpc/health/grpc_health_v1alpha/health.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package grpc.health.v1alpha; - -message HealthCheckRequest { - string service = 1; -} - -message HealthCheckResponse { - enum ServingStatus { - UNKNOWN = 0; - SERVING = 1; - NOT_SERVING = 2; - } - ServingStatus status = 1; -} - -service Health{ - rpc Check(HealthCheckRequest) returns (HealthCheckResponse); -} diff --git a/vendor/google.golang.org/grpc/health/health.go b/vendor/google.golang.org/grpc/health/health.go deleted file mode 100644 index 7930bde7f3d..00000000000 --- a/vendor/google.golang.org/grpc/health/health.go +++ /dev/null @@ -1,49 +0,0 @@ -// Package health provides some utility functions to health-check a server. The implementation -// is based on protobuf. Users need to write their own implementations if other IDLs are used. -package health - -import ( - "sync" - - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - healthpb "google.golang.org/grpc/health/grpc_health_v1alpha" -) - -type HealthServer struct { - mu sync.Mutex - // statusMap stores the serving status of the services this HealthServer monitors. - statusMap map[string]healthpb.HealthCheckResponse_ServingStatus -} - -func NewHealthServer() *HealthServer { - return &HealthServer{ - statusMap: make(map[string]healthpb.HealthCheckResponse_ServingStatus), - } -} - -func (s *HealthServer) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error) { - s.mu.Lock() - defer s.mu.Unlock() - if in.Service == "" { - // check the server overall health status. - return &healthpb.HealthCheckResponse{ - Status: healthpb.HealthCheckResponse_SERVING, - }, nil - } - if status, ok := s.statusMap[in.Service]; ok { - return &healthpb.HealthCheckResponse{ - Status: status, - }, nil - } - return nil, grpc.Errorf(codes.NotFound, "unknown service") -} - -// SetServingStatus is called when need to reset the serving status of a service -// or insert a new service entry into the statusMap. -func (s *HealthServer) SetServingStatus(service string, status healthpb.HealthCheckResponse_ServingStatus) { - s.mu.Lock() - s.statusMap[service] = status - s.mu.Unlock() -} diff --git a/vendor/google.golang.org/grpc/interop/client/client.go b/vendor/google.golang.org/grpc/interop/client/client.go deleted file mode 100644 index deb9c3d848d..00000000000 --- a/vendor/google.golang.org/grpc/interop/client/client.go +++ /dev/null @@ -1,172 +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. - * - */ - -package main - -import ( - "flag" - "net" - "strconv" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/oauth" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/interop" - testpb "google.golang.org/grpc/interop/grpc_testing" -) - -var ( - useTLS = flag.Bool("use_tls", false, "Connection uses TLS if true, else plain TCP") - testCA = flag.Bool("use_test_ca", false, "Whether to replace platform root CAs with test CA as the CA root") - serviceAccountKeyFile = flag.String("service_account_key_file", "", "Path to service account json key file") - oauthScope = flag.String("oauth_scope", "", "The scope for OAuth2 tokens") - defaultServiceAccount = flag.String("default_service_account", "", "Email of GCE default service account") - serverHost = flag.String("server_host", "127.0.0.1", "The server host name") - serverPort = flag.Int("server_port", 10000, "The server port number") - tlsServerName = flag.String("server_host_override", "x.test.youtube.com", "The server name use to verify the hostname returned by TLS handshake if it is not empty. Otherwise, --server_host is used.") - testCase = flag.String("test_case", "large_unary", - `Configure different test cases. Valid options are: - empty_unary : empty (zero bytes) request and response; - large_unary : single request and (large) response; - client_streaming : request streaming with single response; - server_streaming : single request with response streaming; - ping_pong : full-duplex streaming; - empty_stream : full-duplex streaming with zero message; - timeout_on_sleeping_server: fullduplex streaming on a sleeping server; - compute_engine_creds: large_unary with compute engine auth; - service_account_creds: large_unary with service account auth; - jwt_token_creds: large_unary with jwt token auth; - per_rpc_creds: large_unary with per rpc token; - oauth2_auth_token: large_unary with oauth2 token auth; - cancel_after_begin: cancellation after metadata has been sent but before payloads are sent; - cancel_after_first_response: cancellation after receiving 1st message from the server.`) - - // The test CA root cert file - testCAFile = "testdata/ca.pem" -) - -func main() { - flag.Parse() - serverAddr := net.JoinHostPort(*serverHost, strconv.Itoa(*serverPort)) - var opts []grpc.DialOption - if *useTLS { - var sn string - if *tlsServerName != "" { - sn = *tlsServerName - } - var creds credentials.TransportAuthenticator - if *testCA { - var err error - creds, err = credentials.NewClientTLSFromFile(testCAFile, sn) - if err != nil { - grpclog.Fatalf("Failed to create TLS credentials %v", err) - } - } else { - creds = credentials.NewClientTLSFromCert(nil, sn) - } - opts = append(opts, grpc.WithTransportCredentials(creds)) - if *testCase == "compute_engine_creds" { - opts = append(opts, grpc.WithPerRPCCredentials(oauth.NewComputeEngine())) - } else if *testCase == "service_account_creds" { - jwtCreds, err := oauth.NewServiceAccountFromFile(*serviceAccountKeyFile, *oauthScope) - if err != nil { - grpclog.Fatalf("Failed to create JWT credentials: %v", err) - } - opts = append(opts, grpc.WithPerRPCCredentials(jwtCreds)) - } else if *testCase == "jwt_token_creds" { - jwtCreds, err := oauth.NewJWTAccessFromFile(*serviceAccountKeyFile) - if err != nil { - grpclog.Fatalf("Failed to create JWT credentials: %v", err) - } - opts = append(opts, grpc.WithPerRPCCredentials(jwtCreds)) - } else if *testCase == "oauth2_auth_token" { - opts = append(opts, grpc.WithPerRPCCredentials(oauth.NewOauthAccess(interop.GetToken(*serviceAccountKeyFile, *oauthScope)))) - } - } else { - opts = append(opts, grpc.WithInsecure()) - } - conn, err := grpc.Dial(serverAddr, opts...) - if err != nil { - grpclog.Fatalf("Fail to dial: %v", err) - } - defer conn.Close() - tc := testpb.NewTestServiceClient(conn) - switch *testCase { - case "empty_unary": - interop.DoEmptyUnaryCall(tc) - case "large_unary": - interop.DoLargeUnaryCall(tc) - case "client_streaming": - interop.DoClientStreaming(tc) - case "server_streaming": - interop.DoServerStreaming(tc) - case "ping_pong": - interop.DoPingPong(tc) - case "empty_stream": - interop.DoEmptyStream(tc) - case "timeout_on_sleeping_server": - interop.DoTimeoutOnSleepingServer(tc) - case "compute_engine_creds": - if !*useTLS { - grpclog.Fatalf("TLS is not enabled. TLS is required to execute compute_engine_creds test case.") - } - interop.DoComputeEngineCreds(tc, *defaultServiceAccount, *oauthScope) - case "service_account_creds": - if !*useTLS { - grpclog.Fatalf("TLS is not enabled. TLS is required to execute service_account_creds test case.") - } - interop.DoServiceAccountCreds(tc, *serviceAccountKeyFile, *oauthScope) - case "jwt_token_creds": - if !*useTLS { - grpclog.Fatalf("TLS is not enabled. TLS is required to execute jwt_token_creds test case.") - } - interop.DoJWTTokenCreds(tc, *serviceAccountKeyFile) - case "per_rpc_creds": - if !*useTLS { - grpclog.Fatalf("TLS is not enabled. TLS is required to execute per_rpc_creds test case.") - } - interop.DoPerRPCCreds(tc, *serviceAccountKeyFile, *oauthScope) - case "oauth2_auth_token": - if !*useTLS { - grpclog.Fatalf("TLS is not enabled. TLS is required to execute oauth2_auth_token test case.") - } - interop.DoOauth2TokenCreds(tc, *serviceAccountKeyFile, *oauthScope) - case "cancel_after_begin": - interop.DoCancelAfterBegin(tc) - case "cancel_after_first_response": - interop.DoCancelAfterFirstResponse(tc) - default: - grpclog.Fatal("Unsupported test case: ", *testCase) - } -} diff --git a/vendor/google.golang.org/grpc/interop/grpc_testing/test.pb.go b/vendor/google.golang.org/grpc/interop/grpc_testing/test.pb.go deleted file mode 100644 index 7b0803f5523..00000000000 --- a/vendor/google.golang.org/grpc/interop/grpc_testing/test.pb.go +++ /dev/null @@ -1,767 +0,0 @@ -// Code generated by protoc-gen-go. -// source: test.proto -// DO NOT EDIT! - -/* -Package grpc_testing is a generated protocol buffer package. - -It is generated from these files: - test.proto - -It has these top-level messages: - Empty - Payload - SimpleRequest - SimpleResponse - StreamingInputCallRequest - StreamingInputCallResponse - ResponseParameters - StreamingOutputCallRequest - StreamingOutputCallResponse -*/ -package grpc_testing - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -// The type of payload that should be returned. -type PayloadType int32 - -const ( - // Compressable text format. - PayloadType_COMPRESSABLE PayloadType = 0 - // Uncompressable binary format. - PayloadType_UNCOMPRESSABLE PayloadType = 1 - // Randomly chosen from all other formats defined in this enum. - PayloadType_RANDOM PayloadType = 2 -) - -var PayloadType_name = map[int32]string{ - 0: "COMPRESSABLE", - 1: "UNCOMPRESSABLE", - 2: "RANDOM", -} -var PayloadType_value = map[string]int32{ - "COMPRESSABLE": 0, - "UNCOMPRESSABLE": 1, - "RANDOM": 2, -} - -func (x PayloadType) Enum() *PayloadType { - p := new(PayloadType) - *p = x - return p -} -func (x PayloadType) String() string { - return proto.EnumName(PayloadType_name, int32(x)) -} -func (x *PayloadType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PayloadType_value, data, "PayloadType") - if err != nil { - return err - } - *x = PayloadType(value) - return nil -} -func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -type Empty struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -// A block of data, to simply increase gRPC message size. -type Payload struct { - // The type of data in body. - Type *PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"` - // Primary contents of payload. - Body []byte `protobuf:"bytes,2,opt,name=body" json:"body,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Payload) Reset() { *m = Payload{} } -func (m *Payload) String() string { return proto.CompactTextString(m) } -func (*Payload) ProtoMessage() {} -func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Payload) GetType() PayloadType { - if m != nil && m.Type != nil { - return *m.Type - } - return PayloadType_COMPRESSABLE -} - -func (m *Payload) GetBody() []byte { - if m != nil { - return m.Body - } - return nil -} - -// Unary request. -type SimpleRequest struct { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - ResponseType *PayloadType `protobuf:"varint,1,opt,name=response_type,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - ResponseSize *int32 `protobuf:"varint,2,opt,name=response_size" json:"response_size,omitempty"` - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` - // Whether SimpleResponse should include username. - FillUsername *bool `protobuf:"varint,4,opt,name=fill_username" json:"fill_username,omitempty"` - // Whether SimpleResponse should include OAuth scope. - FillOauthScope *bool `protobuf:"varint,5,opt,name=fill_oauth_scope" json:"fill_oauth_scope,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } -func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } -func (*SimpleRequest) ProtoMessage() {} -func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -func (m *SimpleRequest) GetResponseType() PayloadType { - if m != nil && m.ResponseType != nil { - return *m.ResponseType - } - return PayloadType_COMPRESSABLE -} - -func (m *SimpleRequest) GetResponseSize() int32 { - if m != nil && m.ResponseSize != nil { - return *m.ResponseSize - } - return 0 -} - -func (m *SimpleRequest) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *SimpleRequest) GetFillUsername() bool { - if m != nil && m.FillUsername != nil { - return *m.FillUsername - } - return false -} - -func (m *SimpleRequest) GetFillOauthScope() bool { - if m != nil && m.FillOauthScope != nil { - return *m.FillOauthScope - } - return false -} - -// Unary response, as configured by the request. -type SimpleResponse struct { - // Payload to increase message size. - Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` - // The user the request came from, for verifying authentication was - // successful when the client expected it. - Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` - // OAuth scope. - OauthScope *string `protobuf:"bytes,3,opt,name=oauth_scope" json:"oauth_scope,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } -func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } -func (*SimpleResponse) ProtoMessage() {} -func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *SimpleResponse) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *SimpleResponse) GetUsername() string { - if m != nil && m.Username != nil { - return *m.Username - } - return "" -} - -func (m *SimpleResponse) GetOauthScope() string { - if m != nil && m.OauthScope != nil { - return *m.OauthScope - } - return "" -} - -// Client-streaming request. -type StreamingInputCallRequest struct { - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } -func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } -func (*StreamingInputCallRequest) ProtoMessage() {} -func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -func (m *StreamingInputCallRequest) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -// Client-streaming response. -type StreamingInputCallResponse struct { - // Aggregated size of payloads received from the client. - AggregatedPayloadSize *int32 `protobuf:"varint,1,opt,name=aggregated_payload_size" json:"aggregated_payload_size,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } -func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } -func (*StreamingInputCallResponse) ProtoMessage() {} -func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - -func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { - if m != nil && m.AggregatedPayloadSize != nil { - return *m.AggregatedPayloadSize - } - return 0 -} - -// Configuration for a particular response. -type ResponseParameters struct { - // Desired payload sizes in responses from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - Size *int32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"` - // Desired interval between consecutive responses in the response stream in - // microseconds. - IntervalUs *int32 `protobuf:"varint,2,opt,name=interval_us" json:"interval_us,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } -func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } -func (*ResponseParameters) ProtoMessage() {} -func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } - -func (m *ResponseParameters) GetSize() int32 { - if m != nil && m.Size != nil { - return *m.Size - } - return 0 -} - -func (m *ResponseParameters) GetIntervalUs() int32 { - if m != nil && m.IntervalUs != nil { - return *m.IntervalUs - } - return 0 -} - -// Server-streaming request. -type StreamingOutputCallRequest struct { - // Desired payload type in the response from the server. - // If response_type is RANDOM, the payload from each response in the stream - // might be of different types. This is to simulate a mixed type of payload - // stream. - ResponseType *PayloadType `protobuf:"varint,1,opt,name=response_type,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` - // Configuration for each expected response message. - ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters" json:"response_parameters,omitempty"` - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } -func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } -func (*StreamingOutputCallRequest) ProtoMessage() {} -func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } - -func (m *StreamingOutputCallRequest) GetResponseType() PayloadType { - if m != nil && m.ResponseType != nil { - return *m.ResponseType - } - return PayloadType_COMPRESSABLE -} - -func (m *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters { - if m != nil { - return m.ResponseParameters - } - return nil -} - -func (m *StreamingOutputCallRequest) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -// Server-streaming response, as configured by the request and parameters. -type StreamingOutputCallResponse struct { - // Payload to increase response size. - Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } -func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } -func (*StreamingOutputCallResponse) ProtoMessage() {} -func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } - -func (m *StreamingOutputCallResponse) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -func init() { - proto.RegisterType((*Empty)(nil), "grpc.testing.Empty") - proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") - proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") - proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") - proto.RegisterType((*StreamingInputCallRequest)(nil), "grpc.testing.StreamingInputCallRequest") - proto.RegisterType((*StreamingInputCallResponse)(nil), "grpc.testing.StreamingInputCallResponse") - proto.RegisterType((*ResponseParameters)(nil), "grpc.testing.ResponseParameters") - proto.RegisterType((*StreamingOutputCallRequest)(nil), "grpc.testing.StreamingOutputCallRequest") - proto.RegisterType((*StreamingOutputCallResponse)(nil), "grpc.testing.StreamingOutputCallResponse") - proto.RegisterEnum("grpc.testing.PayloadType", PayloadType_name, PayloadType_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// Client API for TestService service - -type TestServiceClient interface { - // One empty request followed by one empty response. - EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) - // One request followed by one response. - // The server returns the client payload as-is. - UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) - // One request followed by a sequence of responses (streamed download). - // The server returns the payload with client desired type and sizes. - StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) - // A sequence of requests followed by one response (streamed upload). - // The server returns the aggregated size of client payload as the result. - StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingInputCallClient, error) - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) - // A sequence of requests followed by a sequence of responses. - // The server buffers all the client requests and then serves them in order. A - // stream of responses are returned to the client when the server starts with - // first request. - HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error) -} - -type testServiceClient struct { - cc *grpc.ClientConn -} - -func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient { - return &testServiceClient{cc} -} - -func (c *testServiceClient) EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := grpc.Invoke(ctx, "/grpc.testing.TestService/EmptyCall", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { - out := new(SimpleResponse) - err := grpc.Invoke(ctx, "/grpc.testing.TestService/UnaryCall", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testServiceClient) StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) { - stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/grpc.testing.TestService/StreamingOutputCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceStreamingOutputCallClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type TestService_StreamingOutputCallClient interface { - Recv() (*StreamingOutputCallResponse, error) - grpc.ClientStream -} - -type testServiceStreamingOutputCallClient struct { - grpc.ClientStream -} - -func (x *testServiceStreamingOutputCallClient) Recv() (*StreamingOutputCallResponse, error) { - m := new(StreamingOutputCallResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testServiceClient) StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingInputCallClient, error) { - stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[1], c.cc, "/grpc.testing.TestService/StreamingInputCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceStreamingInputCallClient{stream} - return x, nil -} - -type TestService_StreamingInputCallClient interface { - Send(*StreamingInputCallRequest) error - CloseAndRecv() (*StreamingInputCallResponse, error) - grpc.ClientStream -} - -type testServiceStreamingInputCallClient struct { - grpc.ClientStream -} - -func (x *testServiceStreamingInputCallClient) Send(m *StreamingInputCallRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testServiceStreamingInputCallClient) CloseAndRecv() (*StreamingInputCallResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(StreamingInputCallResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testServiceClient) FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) { - stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[2], c.cc, "/grpc.testing.TestService/FullDuplexCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceFullDuplexCallClient{stream} - return x, nil -} - -type TestService_FullDuplexCallClient interface { - Send(*StreamingOutputCallRequest) error - Recv() (*StreamingOutputCallResponse, error) - grpc.ClientStream -} - -type testServiceFullDuplexCallClient struct { - grpc.ClientStream -} - -func (x *testServiceFullDuplexCallClient) Send(m *StreamingOutputCallRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testServiceFullDuplexCallClient) Recv() (*StreamingOutputCallResponse, error) { - m := new(StreamingOutputCallResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testServiceClient) HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error) { - stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[3], c.cc, "/grpc.testing.TestService/HalfDuplexCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceHalfDuplexCallClient{stream} - return x, nil -} - -type TestService_HalfDuplexCallClient interface { - Send(*StreamingOutputCallRequest) error - Recv() (*StreamingOutputCallResponse, error) - grpc.ClientStream -} - -type testServiceHalfDuplexCallClient struct { - grpc.ClientStream -} - -func (x *testServiceHalfDuplexCallClient) Send(m *StreamingOutputCallRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testServiceHalfDuplexCallClient) Recv() (*StreamingOutputCallResponse, error) { - m := new(StreamingOutputCallResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Server API for TestService service - -type TestServiceServer interface { - // One empty request followed by one empty response. - EmptyCall(context.Context, *Empty) (*Empty, error) - // One request followed by one response. - // The server returns the client payload as-is. - UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) - // One request followed by a sequence of responses (streamed download). - // The server returns the payload with client desired type and sizes. - StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error - // A sequence of requests followed by one response (streamed upload). - // The server returns the aggregated size of client payload as the result. - StreamingInputCall(TestService_StreamingInputCallServer) error - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - FullDuplexCall(TestService_FullDuplexCallServer) error - // A sequence of requests followed by a sequence of responses. - // The server buffers all the client requests and then serves them in order. A - // stream of responses are returned to the client when the server starts with - // first request. - HalfDuplexCall(TestService_HalfDuplexCallServer) error -} - -func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { - s.RegisterService(&_TestService_serviceDesc, srv) -} - -func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - out, err := srv.(TestServiceServer).EmptyCall(ctx, in) - if err != nil { - return nil, err - } - return out, nil -} - -func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { - in := new(SimpleRequest) - if err := dec(in); err != nil { - return nil, err - } - out, err := srv.(TestServiceServer).UnaryCall(ctx, in) - if err != nil { - return nil, err - } - return out, nil -} - -func _TestService_StreamingOutputCall_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(StreamingOutputCallRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(TestServiceServer).StreamingOutputCall(m, &testServiceStreamingOutputCallServer{stream}) -} - -type TestService_StreamingOutputCallServer interface { - Send(*StreamingOutputCallResponse) error - grpc.ServerStream -} - -type testServiceStreamingOutputCallServer struct { - grpc.ServerStream -} - -func (x *testServiceStreamingOutputCallServer) Send(m *StreamingOutputCallResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _TestService_StreamingInputCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServiceServer).StreamingInputCall(&testServiceStreamingInputCallServer{stream}) -} - -type TestService_StreamingInputCallServer interface { - SendAndClose(*StreamingInputCallResponse) error - Recv() (*StreamingInputCallRequest, error) - grpc.ServerStream -} - -type testServiceStreamingInputCallServer struct { - grpc.ServerStream -} - -func (x *testServiceStreamingInputCallServer) SendAndClose(m *StreamingInputCallResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testServiceStreamingInputCallServer) Recv() (*StreamingInputCallRequest, error) { - m := new(StreamingInputCallRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _TestService_FullDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServiceServer).FullDuplexCall(&testServiceFullDuplexCallServer{stream}) -} - -type TestService_FullDuplexCallServer interface { - Send(*StreamingOutputCallResponse) error - Recv() (*StreamingOutputCallRequest, error) - grpc.ServerStream -} - -type testServiceFullDuplexCallServer struct { - grpc.ServerStream -} - -func (x *testServiceFullDuplexCallServer) Send(m *StreamingOutputCallResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testServiceFullDuplexCallServer) Recv() (*StreamingOutputCallRequest, error) { - m := new(StreamingOutputCallRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _TestService_HalfDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServiceServer).HalfDuplexCall(&testServiceHalfDuplexCallServer{stream}) -} - -type TestService_HalfDuplexCallServer interface { - Send(*StreamingOutputCallResponse) error - Recv() (*StreamingOutputCallRequest, error) - grpc.ServerStream -} - -type testServiceHalfDuplexCallServer struct { - grpc.ServerStream -} - -func (x *testServiceHalfDuplexCallServer) Send(m *StreamingOutputCallResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testServiceHalfDuplexCallServer) Recv() (*StreamingOutputCallRequest, error) { - m := new(StreamingOutputCallRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _TestService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.testing.TestService", - HandlerType: (*TestServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EmptyCall", - Handler: _TestService_EmptyCall_Handler, - }, - { - MethodName: "UnaryCall", - Handler: _TestService_UnaryCall_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamingOutputCall", - Handler: _TestService_StreamingOutputCall_Handler, - ServerStreams: true, - }, - { - StreamName: "StreamingInputCall", - Handler: _TestService_StreamingInputCall_Handler, - ClientStreams: true, - }, - { - StreamName: "FullDuplexCall", - Handler: _TestService_FullDuplexCall_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "HalfDuplexCall", - Handler: _TestService_HalfDuplexCall_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, -} - -var fileDescriptor0 = []byte{ - // 567 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x54, 0x51, 0x6f, 0xd2, 0x50, - 0x14, 0xb6, 0x03, 0x64, 0x1c, 0x58, 0x43, 0x0e, 0x59, 0x64, 0x9d, 0x89, 0x4b, 0x7d, 0xb0, 0x9a, - 0x88, 0x86, 0x44, 0x1f, 0x35, 0x73, 0x63, 0x71, 0x09, 0x03, 0x6c, 0xe1, 0x99, 0x5c, 0xe1, 0x0e, - 0x9b, 0x94, 0xb6, 0xb6, 0xb7, 0x46, 0x7c, 0xf0, 0x8f, 0xf9, 0x67, 0xfc, 0x11, 0xfe, 0x00, 0xef, - 0xbd, 0x6d, 0xa1, 0x40, 0x17, 0x99, 0xc6, 0xbd, 0xb5, 0xdf, 0xf9, 0xce, 0x77, 0xbe, 0xef, 0x9e, - 0xdb, 0x02, 0x30, 0x1a, 0xb2, 0x96, 0x1f, 0x78, 0xcc, 0xc3, 0xda, 0x2c, 0xf0, 0x27, 0x2d, 0x01, - 0xd8, 0xee, 0x4c, 0x2f, 0x43, 0xa9, 0x33, 0xf7, 0xd9, 0x42, 0xef, 0x42, 0x79, 0x40, 0x16, 0x8e, - 0x47, 0xa6, 0xf8, 0x1c, 0x8a, 0x6c, 0xe1, 0xd3, 0xa6, 0x72, 0xa2, 0x18, 0x6a, 0xfb, 0xa8, 0x95, - 0x6d, 0x68, 0x25, 0xa4, 0x21, 0x27, 0x98, 0x92, 0x86, 0x08, 0xc5, 0x8f, 0xde, 0x74, 0xd1, 0xdc, - 0xe3, 0xf4, 0x9a, 0x29, 0x9f, 0xf5, 0x5f, 0x0a, 0x1c, 0x58, 0xf6, 0xdc, 0x77, 0xa8, 0x49, 0x3f, - 0x47, 0xbc, 0x15, 0xdf, 0xc0, 0x41, 0x40, 0x43, 0xdf, 0x73, 0x43, 0x3a, 0xde, 0x4d, 0xbd, 0x96, - 0xf2, 0xc5, 0x1b, 0x3e, 0xce, 0xf4, 0x87, 0xf6, 0x37, 0x2a, 0xc7, 0x95, 0x56, 0x24, 0x8b, 0x63, - 0xf8, 0x02, 0xca, 0x7e, 0xac, 0xd0, 0x2c, 0xf0, 0x72, 0xb5, 0x7d, 0x98, 0x2b, 0x6f, 0xa6, 0x2c, - 0xa1, 0x7a, 0x6d, 0x3b, 0xce, 0x38, 0x0a, 0x69, 0xe0, 0x92, 0x39, 0x6d, 0x16, 0x79, 0xdb, 0xbe, - 0x59, 0x13, 0xe0, 0x28, 0xc1, 0xd0, 0x80, 0xba, 0x24, 0x79, 0x24, 0x62, 0x9f, 0xc6, 0xe1, 0xc4, - 0xe3, 0xee, 0x4b, 0x92, 0xa7, 0x0a, 0xbc, 0x2f, 0x60, 0x4b, 0xa0, 0xfa, 0x77, 0x50, 0xd3, 0xd4, - 0xb1, 0xab, 0xac, 0x23, 0x65, 0x27, 0x47, 0x1a, 0xec, 0x2f, 0xcd, 0x88, 0x88, 0x15, 0x73, 0xf9, - 0x8e, 0x8f, 0xa0, 0x9a, 0xf5, 0x50, 0x90, 0x65, 0xf0, 0x56, 0xf3, 0xbb, 0x70, 0x64, 0xb1, 0x80, - 0x92, 0x39, 0x97, 0xbe, 0x74, 0xfd, 0x88, 0x9d, 0x11, 0xc7, 0x49, 0x37, 0x70, 0x5b, 0x2b, 0xfa, - 0x10, 0xb4, 0x3c, 0xb5, 0x24, 0xd9, 0x6b, 0x78, 0x40, 0x66, 0xb3, 0x80, 0xce, 0x08, 0xa3, 0xd3, - 0x71, 0xd2, 0x13, 0xaf, 0x46, 0x91, 0xab, 0x39, 0x5c, 0x95, 0x13, 0x69, 0xb1, 0x23, 0xfd, 0x12, - 0x30, 0xd5, 0x18, 0x90, 0x80, 0xc7, 0x62, 0x34, 0x08, 0xc5, 0x25, 0xca, 0xb4, 0xca, 0x67, 0x11, - 0xd7, 0x76, 0x79, 0xf5, 0x0b, 0x11, 0x0b, 0x4a, 0x16, 0x0e, 0x29, 0x34, 0x0a, 0xf5, 0x9f, 0x4a, - 0xc6, 0x61, 0x3f, 0x62, 0x1b, 0x81, 0xff, 0xf5, 0xca, 0x7d, 0x80, 0xc6, 0xb2, 0xdf, 0x5f, 0x5a, - 0xe5, 0x3e, 0x0a, 0xfc, 0xf0, 0x4e, 0xd6, 0x55, 0xb6, 0x23, 0x99, 0x18, 0x6c, 0xc7, 0xbc, 0xed, - 0x05, 0xd5, 0x7b, 0x70, 0x9c, 0x9b, 0xf0, 0x2f, 0xaf, 0xd7, 0xb3, 0xb7, 0x50, 0xcd, 0x04, 0xc6, - 0x3a, 0xd4, 0xce, 0xfa, 0x57, 0x03, 0xb3, 0x63, 0x59, 0xa7, 0xef, 0xba, 0x9d, 0xfa, 0x3d, 0xbe, - 0x08, 0x75, 0xd4, 0x5b, 0xc3, 0x14, 0x04, 0xb8, 0x6f, 0x9e, 0xf6, 0xce, 0xfb, 0x57, 0xf5, 0xbd, - 0xf6, 0x8f, 0x22, 0x54, 0x87, 0x5c, 0xdd, 0xe2, 0x4b, 0xb0, 0x27, 0x14, 0x5f, 0x41, 0x45, 0xfe, - 0x40, 0x84, 0x2d, 0x6c, 0xac, 0x4f, 0x97, 0x05, 0x2d, 0x0f, 0xc4, 0x0b, 0xa8, 0x8c, 0x5c, 0x12, - 0xc4, 0x6d, 0xc7, 0xeb, 0x8c, 0xb5, 0x1f, 0x87, 0xf6, 0x30, 0xbf, 0x98, 0x1c, 0x80, 0x03, 0x8d, - 0x9c, 0xf3, 0x41, 0x63, 0xa3, 0xe9, 0xc6, 0x4b, 0xa2, 0x3d, 0xdd, 0x81, 0x19, 0xcf, 0x7a, 0xa9, - 0xa0, 0x0d, 0xb8, 0xfd, 0x45, 0xe0, 0x93, 0x1b, 0x24, 0x36, 0xbf, 0x40, 0xcd, 0xf8, 0x33, 0x31, - 0x1e, 0x65, 0x88, 0x51, 0xea, 0x45, 0xe4, 0x38, 0xe7, 0x11, 0x4f, 0xfb, 0xf5, 0xbf, 0x65, 0x32, - 0x14, 0x99, 0x4a, 0x7d, 0x4f, 0x9c, 0xeb, 0x3b, 0x18, 0xf5, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x4c, - 0x41, 0xfe, 0xb6, 0x89, 0x06, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/grpc/interop/grpc_testing/test.proto b/vendor/google.golang.org/grpc/interop/grpc_testing/test.proto deleted file mode 100644 index b5bfe053789..00000000000 --- a/vendor/google.golang.org/grpc/interop/grpc_testing/test.proto +++ /dev/null @@ -1,140 +0,0 @@ -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. -syntax = "proto2"; - -package grpc.testing; - -message Empty {} - -// The type of payload that should be returned. -enum PayloadType { - // Compressable text format. - COMPRESSABLE = 0; - - // Uncompressable binary format. - UNCOMPRESSABLE = 1; - - // Randomly chosen from all other formats defined in this enum. - RANDOM = 2; -} - -// A block of data, to simply increase gRPC message size. -message Payload { - // The type of data in body. - optional PayloadType type = 1; - // Primary contents of payload. - optional bytes body = 2; -} - -// Unary request. -message SimpleRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - optional PayloadType response_type = 1; - - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - optional int32 response_size = 2; - - // Optional input payload sent along with the request. - optional Payload payload = 3; - - // Whether SimpleResponse should include username. - optional bool fill_username = 4; - - // Whether SimpleResponse should include OAuth scope. - optional bool fill_oauth_scope = 5; -} - -// Unary response, as configured by the request. -message SimpleResponse { - // Payload to increase message size. - optional Payload payload = 1; - - // The user the request came from, for verifying authentication was - // successful when the client expected it. - optional string username = 2; - - // OAuth scope. - optional string oauth_scope = 3; -} - -// Client-streaming request. -message StreamingInputCallRequest { - // Optional input payload sent along with the request. - optional Payload payload = 1; - - // Not expecting any payload from the response. -} - -// Client-streaming response. -message StreamingInputCallResponse { - // Aggregated size of payloads received from the client. - optional int32 aggregated_payload_size = 1; -} - -// Configuration for a particular response. -message ResponseParameters { - // Desired payload sizes in responses from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - optional int32 size = 1; - - // Desired interval between consecutive responses in the response stream in - // microseconds. - optional int32 interval_us = 2; -} - -// Server-streaming request. -message StreamingOutputCallRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, the payload from each response in the stream - // might be of different types. This is to simulate a mixed type of payload - // stream. - optional PayloadType response_type = 1; - - // Configuration for each expected response message. - repeated ResponseParameters response_parameters = 2; - - // Optional input payload sent along with the request. - optional Payload payload = 3; -} - -// Server-streaming response, as configured by the request and parameters. -message StreamingOutputCallResponse { - // Payload to increase response size. - optional Payload payload = 1; -} - -// A simple service to test the various types of RPCs and experiment with -// performance with various types of payload. -service TestService { - // One empty request followed by one empty response. - rpc EmptyCall(Empty) returns (Empty); - - // One request followed by one response. - // The server returns the client payload as-is. - rpc UnaryCall(SimpleRequest) returns (SimpleResponse); - - // One request followed by a sequence of responses (streamed download). - // The server returns the payload with client desired type and sizes. - rpc StreamingOutputCall(StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); - - // A sequence of requests followed by one response (streamed upload). - // The server returns the aggregated size of client payload as the result. - rpc StreamingInputCall(stream StreamingInputCallRequest) - returns (StreamingInputCallResponse); - - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - rpc FullDuplexCall(stream StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); - - // A sequence of requests followed by a sequence of responses. - // The server buffers all the client requests and then serves them in order. A - // stream of responses are returned to the client when the server starts with - // first request. - rpc HalfDuplexCall(stream StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); -} diff --git a/vendor/google.golang.org/grpc/interop/server/server.go b/vendor/google.golang.org/grpc/interop/server/server.go deleted file mode 100644 index 36ebcb6418e..00000000000 --- a/vendor/google.golang.org/grpc/interop/server/server.go +++ /dev/null @@ -1,73 +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. - * - */ - -package main - -import ( - "flag" - "net" - "strconv" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/interop" - testpb "google.golang.org/grpc/interop/grpc_testing" -) - -var ( - useTLS = flag.Bool("use_tls", false, "Connection uses TLS if true, else plain TCP") - certFile = flag.String("tls_cert_file", "testdata/server1.pem", "The TLS cert file") - keyFile = flag.String("tls_key_file", "testdata/server1.key", "The TLS key file") - port = flag.Int("port", 10000, "The server port") -) - -func main() { - flag.Parse() - p := strconv.Itoa(*port) - lis, err := net.Listen("tcp", ":"+p) - if err != nil { - grpclog.Fatalf("failed to listen: %v", err) - } - var opts []grpc.ServerOption - if *useTLS { - creds, err := credentials.NewServerTLSFromFile(*certFile, *keyFile) - if err != nil { - grpclog.Fatalf("Failed to generate credentials %v", err) - } - opts = []grpc.ServerOption{grpc.Creds(creds)} - } - server := grpc.NewServer(opts...) - testpb.RegisterTestServiceServer(server, interop.NewTestServer()) - server.Serve(lis) -} diff --git a/vendor/google.golang.org/grpc/interop/test_utils.go b/vendor/google.golang.org/grpc/interop/test_utils.go deleted file mode 100644 index 6a73d6f4533..00000000000 --- a/vendor/google.golang.org/grpc/interop/test_utils.go +++ /dev/null @@ -1,607 +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. - * - */ - -package interop - -import ( - "fmt" - "io" - "io/ioutil" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - testpb "google.golang.org/grpc/interop/grpc_testing" - "google.golang.org/grpc/metadata" -) - -var ( - reqSizes = []int{27182, 8, 1828, 45904} - respSizes = []int{31415, 9, 2653, 58979} - largeReqSize = 271828 - largeRespSize = 314159 -) - -func clientNewPayload(t testpb.PayloadType, size int) *testpb.Payload { - if size < 0 { - grpclog.Fatalf("Requested a response with invalid length %d", size) - } - body := make([]byte, size) - switch t { - case testpb.PayloadType_COMPRESSABLE: - case testpb.PayloadType_UNCOMPRESSABLE: - grpclog.Fatalf("PayloadType UNCOMPRESSABLE is not supported") - default: - grpclog.Fatalf("Unsupported payload type: %d", t) - } - return &testpb.Payload{ - Type: t.Enum(), - Body: body, - } -} - -// DoEmptyUnaryCall performs a unary RPC with empty request and response messages. -func DoEmptyUnaryCall(tc testpb.TestServiceClient) { - reply, err := tc.EmptyCall(context.Background(), &testpb.Empty{}) - if err != nil { - grpclog.Fatal("/TestService/EmptyCall RPC failed: ", err) - } - if !proto.Equal(&testpb.Empty{}, reply) { - grpclog.Fatalf("/TestService/EmptyCall receives %v, want %v", reply, testpb.Empty{}) - } - grpclog.Println("EmptyUnaryCall done") -} - -// DoLargeUnaryCall performs a unary RPC with large payload in the request and response. -func DoLargeUnaryCall(tc testpb.TestServiceClient) { - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - t := reply.GetPayload().GetType() - s := len(reply.GetPayload().GetBody()) - if t != testpb.PayloadType_COMPRESSABLE || s != largeRespSize { - grpclog.Fatalf("Got the reply with type %d len %d; want %d, %d", t, s, testpb.PayloadType_COMPRESSABLE, largeRespSize) - } - grpclog.Println("LargeUnaryCall done") -} - -// DoClientStreaming performs a client streaming RPC. -func DoClientStreaming(tc testpb.TestServiceClient) { - stream, err := tc.StreamingInputCall(context.Background()) - if err != nil { - grpclog.Fatalf("%v.StreamingInputCall(_) = _, %v", tc, err) - } - var sum int - for _, s := range reqSizes { - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, s) - req := &testpb.StreamingInputCallRequest{ - Payload: pl, - } - if err := stream.Send(req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) - } - sum += s - grpclog.Printf("Sent a request of size %d, aggregated size %d", s, sum) - - } - reply, err := stream.CloseAndRecv() - if err != nil { - grpclog.Fatalf("%v.CloseAndRecv() got error %v, want %v", stream, err, nil) - } - if reply.GetAggregatedPayloadSize() != int32(sum) { - grpclog.Fatalf("%v.CloseAndRecv().GetAggregatePayloadSize() = %v; want %v", stream, reply.GetAggregatedPayloadSize(), sum) - } - grpclog.Println("ClientStreaming done") -} - -// DoServerStreaming performs a server streaming RPC. -func DoServerStreaming(tc testpb.TestServiceClient) { - respParam := make([]*testpb.ResponseParameters, len(respSizes)) - for i, s := range respSizes { - respParam[i] = &testpb.ResponseParameters{ - Size: proto.Int32(int32(s)), - } - } - req := &testpb.StreamingOutputCallRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseParameters: respParam, - } - stream, err := tc.StreamingOutputCall(context.Background(), req) - if err != nil { - grpclog.Fatalf("%v.StreamingOutputCall(_) = _, %v", tc, err) - } - var rpcStatus error - var respCnt int - var index int - for { - reply, err := stream.Recv() - if err != nil { - rpcStatus = err - break - } - t := reply.GetPayload().GetType() - if t != testpb.PayloadType_COMPRESSABLE { - grpclog.Fatalf("Got the reply of type %d, want %d", t, testpb.PayloadType_COMPRESSABLE) - } - size := len(reply.GetPayload().GetBody()) - if size != int(respSizes[index]) { - grpclog.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) - } - index++ - respCnt++ - } - if rpcStatus != io.EOF { - grpclog.Fatalf("Failed to finish the server streaming rpc: %v", err) - } - if respCnt != len(respSizes) { - grpclog.Fatalf("Got %d reply, want %d", len(respSizes), respCnt) - } - grpclog.Println("ServerStreaming done") -} - -// DoPingPong performs ping-pong style bi-directional streaming RPC. -func DoPingPong(tc testpb.TestServiceClient) { - stream, err := tc.FullDuplexCall(context.Background()) - if err != nil { - grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) - } - var index int - for index < len(reqSizes) { - respParam := []*testpb.ResponseParameters{ - { - Size: proto.Int32(int32(respSizes[index])), - }, - } - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, reqSizes[index]) - req := &testpb.StreamingOutputCallRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseParameters: respParam, - Payload: pl, - } - if err := stream.Send(req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) - } - reply, err := stream.Recv() - if err != nil { - grpclog.Fatalf("%v.Recv() = %v", stream, err) - } - t := reply.GetPayload().GetType() - if t != testpb.PayloadType_COMPRESSABLE { - grpclog.Fatalf("Got the reply of type %d, want %d", t, testpb.PayloadType_COMPRESSABLE) - } - size := len(reply.GetPayload().GetBody()) - if size != int(respSizes[index]) { - grpclog.Fatalf("Got reply body of length %d, want %d", size, respSizes[index]) - } - index++ - } - if err := stream.CloseSend(); err != nil { - grpclog.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) - } - if _, err := stream.Recv(); err != io.EOF { - grpclog.Fatalf("%v failed to complele the ping pong test: %v", stream, err) - } - grpclog.Println("Pingpong done") -} - -// DoEmptyStream sets up a bi-directional streaming with zero message. -func DoEmptyStream(tc testpb.TestServiceClient) { - stream, err := tc.FullDuplexCall(context.Background()) - if err != nil { - grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) - } - if err := stream.CloseSend(); err != nil { - grpclog.Fatalf("%v.CloseSend() got %v, want %v", stream, err, nil) - } - if _, err := stream.Recv(); err != io.EOF { - grpclog.Fatalf("%v failed to complete the empty stream test: %v", stream, err) - } - grpclog.Println("Emptystream done") -} - -// DoTimeoutOnSleepingServer performs an RPC on a sleep server which causes RPC timeout. -func DoTimeoutOnSleepingServer(tc testpb.TestServiceClient) { - ctx, _ := context.WithTimeout(context.Background(), 1*time.Millisecond) - stream, err := tc.FullDuplexCall(ctx) - if err != nil { - if grpc.Code(err) == codes.DeadlineExceeded { - grpclog.Println("TimeoutOnSleepingServer done") - return - } - grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) - } - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, 27182) - req := &testpb.StreamingOutputCallRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - Payload: pl, - } - if err := stream.Send(req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) - } - if _, err := stream.Recv(); grpc.Code(err) != codes.DeadlineExceeded { - grpclog.Fatalf("%v.Recv() = _, %v, want error code %d", stream, err, codes.DeadlineExceeded) - } - grpclog.Println("TimeoutOnSleepingServer done") -} - -// DoComputeEngineCreds performs a unary RPC with compute engine auth. -func DoComputeEngineCreds(tc testpb.TestServiceClient, serviceAccount, oauthScope string) { - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - FillOauthScope: proto.Bool(true), - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - user := reply.GetUsername() - scope := reply.GetOauthScope() - if user != serviceAccount { - grpclog.Fatalf("Got user name %q, want %q.", user, serviceAccount) - } - if !strings.Contains(oauthScope, scope) { - grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) - } - grpclog.Println("ComputeEngineCreds done") -} - -func getServiceAccountJSONKey(keyFile string) []byte { - jsonKey, err := ioutil.ReadFile(keyFile) - if err != nil { - grpclog.Fatalf("Failed to read the service account key file: %v", err) - } - return jsonKey -} - -// DoServiceAccountCreds performs a unary RPC with service account auth. -func DoServiceAccountCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - FillOauthScope: proto.Bool(true), - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) - user := reply.GetUsername() - scope := reply.GetOauthScope() - if !strings.Contains(string(jsonKey), user) { - grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) - } - if !strings.Contains(oauthScope, scope) { - grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) - } - grpclog.Println("ServiceAccountCreds done") -} - -// DoJWTTokenCreds performs a unary RPC with JWT token auth. -func DoJWTTokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile string) { - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) - user := reply.GetUsername() - if !strings.Contains(string(jsonKey), user) { - grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) - } - grpclog.Println("JWTtokenCreds done") -} - -// GetToken obtains an OAUTH token from the input. -func GetToken(serviceAccountKeyFile string, oauthScope string) *oauth2.Token { - jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) - config, err := google.JWTConfigFromJSON(jsonKey, oauthScope) - if err != nil { - grpclog.Fatalf("Failed to get the config: %v", err) - } - token, err := config.TokenSource(context.Background()).Token() - if err != nil { - grpclog.Fatalf("Failed to get the token: %v", err) - } - return token -} - -// DoOauth2TokenCreds performs a unary RPC with OAUTH2 token auth. -func DoOauth2TokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - FillOauthScope: proto.Bool(true), - } - reply, err := tc.UnaryCall(context.Background(), req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) - user := reply.GetUsername() - scope := reply.GetOauthScope() - if !strings.Contains(string(jsonKey), user) { - grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) - } - if !strings.Contains(oauthScope, scope) { - grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) - } - grpclog.Println("Oauth2TokenCreds done") -} - -// DoPerRPCCreds performs a unary RPC with per RPC OAUTH2 token. -func DoPerRPCCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) { - jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile) - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize) - req := &testpb.SimpleRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseSize: proto.Int32(int32(largeRespSize)), - Payload: pl, - FillUsername: proto.Bool(true), - FillOauthScope: proto.Bool(true), - } - token := GetToken(serviceAccountKeyFile, oauthScope) - kv := map[string]string{"authorization": token.TokenType + " " + token.AccessToken} - ctx := metadata.NewContext(context.Background(), metadata.MD{"authorization": []string{kv["authorization"]}}) - reply, err := tc.UnaryCall(ctx, req) - if err != nil { - grpclog.Fatal("/TestService/UnaryCall RPC failed: ", err) - } - user := reply.GetUsername() - scope := reply.GetOauthScope() - if !strings.Contains(string(jsonKey), user) { - grpclog.Fatalf("Got user name %q which is NOT a substring of %q.", user, jsonKey) - } - if !strings.Contains(oauthScope, scope) { - grpclog.Fatalf("Got OAuth scope %q which is NOT a substring of %q.", scope, oauthScope) - } - grpclog.Println("PerRPCCreds done") -} - -var ( - testMetadata = metadata.MD{ - "key1": []string{"value1"}, - "key2": []string{"value2"}, - } -) - -// DoCancelAfterBegin cancels the RPC after metadata has been sent but before payloads are sent. -func DoCancelAfterBegin(tc testpb.TestServiceClient) { - ctx, cancel := context.WithCancel(metadata.NewContext(context.Background(), testMetadata)) - stream, err := tc.StreamingInputCall(ctx) - if err != nil { - grpclog.Fatalf("%v.StreamingInputCall(_) = _, %v", tc, err) - } - cancel() - _, err = stream.CloseAndRecv() - if grpc.Code(err) != codes.Canceled { - grpclog.Fatalf("%v.CloseAndRecv() got error code %d, want %d", stream, grpc.Code(err), codes.Canceled) - } - grpclog.Println("CancelAfterBegin done") -} - -// DoCancelAfterFirstResponse cancels the RPC after receiving the first message from the server. -func DoCancelAfterFirstResponse(tc testpb.TestServiceClient) { - ctx, cancel := context.WithCancel(context.Background()) - stream, err := tc.FullDuplexCall(ctx) - if err != nil { - grpclog.Fatalf("%v.FullDuplexCall(_) = _, %v", tc, err) - } - respParam := []*testpb.ResponseParameters{ - { - Size: proto.Int32(31415), - }, - } - pl := clientNewPayload(testpb.PayloadType_COMPRESSABLE, 27182) - req := &testpb.StreamingOutputCallRequest{ - ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(), - ResponseParameters: respParam, - Payload: pl, - } - if err := stream.Send(req); err != nil { - grpclog.Fatalf("%v.Send(%v) = %v", stream, req, err) - } - if _, err := stream.Recv(); err != nil { - grpclog.Fatalf("%v.Recv() = %v", stream, err) - } - cancel() - if _, err := stream.Recv(); grpc.Code(err) != codes.Canceled { - grpclog.Fatalf("%v compleled with error code %d, want %d", stream, grpc.Code(err), codes.Canceled) - } - grpclog.Println("CancelAfterFirstResponse done") -} - -type testServer struct { -} - -// NewTestServer creates a test server for test service. -func NewTestServer() testpb.TestServiceServer { - return &testServer{} -} - -func (s *testServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) { - return new(testpb.Empty), nil -} - -func serverNewPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) { - if size < 0 { - return nil, fmt.Errorf("requested a response with invalid length %d", size) - } - body := make([]byte, size) - switch t { - case testpb.PayloadType_COMPRESSABLE: - case testpb.PayloadType_UNCOMPRESSABLE: - return nil, fmt.Errorf("payloadType UNCOMPRESSABLE is not supported") - default: - return nil, fmt.Errorf("unsupported payload type: %d", t) - } - return &testpb.Payload{ - Type: t.Enum(), - Body: body, - }, nil -} - -func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) { - pl, err := serverNewPayload(in.GetResponseType(), in.GetResponseSize()) - if err != nil { - return nil, err - } - return &testpb.SimpleResponse{ - Payload: pl, - }, nil -} - -func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testpb.TestService_StreamingOutputCallServer) error { - cs := args.GetResponseParameters() - for _, c := range cs { - if us := c.GetIntervalUs(); us > 0 { - time.Sleep(time.Duration(us) * time.Microsecond) - } - pl, err := serverNewPayload(args.GetResponseType(), c.GetSize()) - if err != nil { - return err - } - if err := stream.Send(&testpb.StreamingOutputCallResponse{ - Payload: pl, - }); err != nil { - return err - } - } - return nil -} - -func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInputCallServer) error { - var sum int - for { - in, err := stream.Recv() - if err == io.EOF { - return stream.SendAndClose(&testpb.StreamingInputCallResponse{ - AggregatedPayloadSize: proto.Int32(int32(sum)), - }) - } - if err != nil { - return err - } - p := in.GetPayload().GetBody() - sum += len(p) - } -} - -func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServer) error { - for { - in, err := stream.Recv() - if err == io.EOF { - // read done. - return nil - } - if err != nil { - return err - } - cs := in.GetResponseParameters() - for _, c := range cs { - if us := c.GetIntervalUs(); us > 0 { - time.Sleep(time.Duration(us) * time.Microsecond) - } - pl, err := serverNewPayload(in.GetResponseType(), c.GetSize()) - if err != nil { - return err - } - if err := stream.Send(&testpb.StreamingOutputCallResponse{ - Payload: pl, - }); err != nil { - return err - } - } - } -} - -func (s *testServer) HalfDuplexCall(stream testpb.TestService_HalfDuplexCallServer) error { - var msgBuf []*testpb.StreamingOutputCallRequest - for { - in, err := stream.Recv() - if err == io.EOF { - // read done. - break - } - if err != nil { - return err - } - msgBuf = append(msgBuf, in) - } - for _, m := range msgBuf { - cs := m.GetResponseParameters() - for _, c := range cs { - if us := c.GetIntervalUs(); us > 0 { - time.Sleep(time.Duration(us) * time.Microsecond) - } - pl, err := serverNewPayload(m.GetResponseType(), c.GetSize()) - if err != nil { - return err - } - if err := stream.Send(&testpb.StreamingOutputCallResponse{ - Payload: pl, - }); err != nil { - return err - } - } - } - return nil -} diff --git a/vendor/google.golang.org/grpc/test/codec_perf/perf.pb.go b/vendor/google.golang.org/grpc/test/codec_perf/perf.pb.go deleted file mode 100644 index 14fae12b81a..00000000000 --- a/vendor/google.golang.org/grpc/test/codec_perf/perf.pb.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by protoc-gen-go. -// source: perf.proto -// DO NOT EDIT! - -/* -Package codec_perf is a generated protocol buffer package. - -It is generated from these files: - perf.proto - -It has these top-level messages: - Buffer -*/ -package codec_perf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -// Buffer is a message that contains a body of bytes that is used to exercise -// encoding and decoding overheads. -type Buffer struct { - Body []byte `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Buffer) Reset() { *m = Buffer{} } -func (m *Buffer) String() string { return proto.CompactTextString(m) } -func (*Buffer) ProtoMessage() {} -func (*Buffer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *Buffer) GetBody() []byte { - if m != nil { - return m.Body - } - return nil -} - -func init() { - proto.RegisterType((*Buffer)(nil), "codec.perf.Buffer") -} - -var fileDescriptor0 = []byte{ - // 73 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x48, 0x2d, 0x4a, - 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4a, 0xce, 0x4f, 0x49, 0x4d, 0xd6, 0x03, 0x89, - 0x28, 0xc9, 0x70, 0xb1, 0x39, 0x95, 0xa6, 0xa5, 0xa5, 0x16, 0x09, 0x09, 0x71, 0xb1, 0x24, 0xe5, - 0xa7, 0x54, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0x81, 0xd9, 0x80, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x3a, 0x58, 0x92, 0x53, 0x36, 0x00, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/grpc/test/codec_perf/perf.proto b/vendor/google.golang.org/grpc/test/codec_perf/perf.proto deleted file mode 100644 index 4cf561f7f1e..00000000000 --- a/vendor/google.golang.org/grpc/test/codec_perf/perf.proto +++ /dev/null @@ -1,11 +0,0 @@ -// Messages used for performance tests that may not reference grpc directly for -// reasons of import cycles. -syntax = "proto2"; - -package codec.perf; - -// Buffer is a message that contains a body of bytes that is used to exercise -// encoding and decoding overheads. -message Buffer { - optional bytes body = 1; -} diff --git a/vendor/google.golang.org/grpc/test/grpc_testing/test.pb.go b/vendor/google.golang.org/grpc/test/grpc_testing/test.pb.go deleted file mode 100644 index 7b0803f5523..00000000000 --- a/vendor/google.golang.org/grpc/test/grpc_testing/test.pb.go +++ /dev/null @@ -1,767 +0,0 @@ -// Code generated by protoc-gen-go. -// source: test.proto -// DO NOT EDIT! - -/* -Package grpc_testing is a generated protocol buffer package. - -It is generated from these files: - test.proto - -It has these top-level messages: - Empty - Payload - SimpleRequest - SimpleResponse - StreamingInputCallRequest - StreamingInputCallResponse - ResponseParameters - StreamingOutputCallRequest - StreamingOutputCallResponse -*/ -package grpc_testing - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -const _ = proto.ProtoPackageIsVersion1 - -// The type of payload that should be returned. -type PayloadType int32 - -const ( - // Compressable text format. - PayloadType_COMPRESSABLE PayloadType = 0 - // Uncompressable binary format. - PayloadType_UNCOMPRESSABLE PayloadType = 1 - // Randomly chosen from all other formats defined in this enum. - PayloadType_RANDOM PayloadType = 2 -) - -var PayloadType_name = map[int32]string{ - 0: "COMPRESSABLE", - 1: "UNCOMPRESSABLE", - 2: "RANDOM", -} -var PayloadType_value = map[string]int32{ - "COMPRESSABLE": 0, - "UNCOMPRESSABLE": 1, - "RANDOM": 2, -} - -func (x PayloadType) Enum() *PayloadType { - p := new(PayloadType) - *p = x - return p -} -func (x PayloadType) String() string { - return proto.EnumName(PayloadType_name, int32(x)) -} -func (x *PayloadType) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(PayloadType_value, data, "PayloadType") - if err != nil { - return err - } - *x = PayloadType(value) - return nil -} -func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -type Empty struct { - XXX_unrecognized []byte `json:"-"` -} - -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -// A block of data, to simply increase gRPC message size. -type Payload struct { - // The type of data in body. - Type *PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"` - // Primary contents of payload. - Body []byte `protobuf:"bytes,2,opt,name=body" json:"body,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Payload) Reset() { *m = Payload{} } -func (m *Payload) String() string { return proto.CompactTextString(m) } -func (*Payload) ProtoMessage() {} -func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *Payload) GetType() PayloadType { - if m != nil && m.Type != nil { - return *m.Type - } - return PayloadType_COMPRESSABLE -} - -func (m *Payload) GetBody() []byte { - if m != nil { - return m.Body - } - return nil -} - -// Unary request. -type SimpleRequest struct { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - ResponseType *PayloadType `protobuf:"varint,1,opt,name=response_type,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - ResponseSize *int32 `protobuf:"varint,2,opt,name=response_size" json:"response_size,omitempty"` - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` - // Whether SimpleResponse should include username. - FillUsername *bool `protobuf:"varint,4,opt,name=fill_username" json:"fill_username,omitempty"` - // Whether SimpleResponse should include OAuth scope. - FillOauthScope *bool `protobuf:"varint,5,opt,name=fill_oauth_scope" json:"fill_oauth_scope,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } -func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } -func (*SimpleRequest) ProtoMessage() {} -func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -func (m *SimpleRequest) GetResponseType() PayloadType { - if m != nil && m.ResponseType != nil { - return *m.ResponseType - } - return PayloadType_COMPRESSABLE -} - -func (m *SimpleRequest) GetResponseSize() int32 { - if m != nil && m.ResponseSize != nil { - return *m.ResponseSize - } - return 0 -} - -func (m *SimpleRequest) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *SimpleRequest) GetFillUsername() bool { - if m != nil && m.FillUsername != nil { - return *m.FillUsername - } - return false -} - -func (m *SimpleRequest) GetFillOauthScope() bool { - if m != nil && m.FillOauthScope != nil { - return *m.FillOauthScope - } - return false -} - -// Unary response, as configured by the request. -type SimpleResponse struct { - // Payload to increase message size. - Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` - // The user the request came from, for verifying authentication was - // successful when the client expected it. - Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"` - // OAuth scope. - OauthScope *string `protobuf:"bytes,3,opt,name=oauth_scope" json:"oauth_scope,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } -func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } -func (*SimpleResponse) ProtoMessage() {} -func (*SimpleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *SimpleResponse) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *SimpleResponse) GetUsername() string { - if m != nil && m.Username != nil { - return *m.Username - } - return "" -} - -func (m *SimpleResponse) GetOauthScope() string { - if m != nil && m.OauthScope != nil { - return *m.OauthScope - } - return "" -} - -// Client-streaming request. -type StreamingInputCallRequest struct { - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} } -func (m *StreamingInputCallRequest) String() string { return proto.CompactTextString(m) } -func (*StreamingInputCallRequest) ProtoMessage() {} -func (*StreamingInputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -func (m *StreamingInputCallRequest) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -// Client-streaming response. -type StreamingInputCallResponse struct { - // Aggregated size of payloads received from the client. - AggregatedPayloadSize *int32 `protobuf:"varint,1,opt,name=aggregated_payload_size" json:"aggregated_payload_size,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} } -func (m *StreamingInputCallResponse) String() string { return proto.CompactTextString(m) } -func (*StreamingInputCallResponse) ProtoMessage() {} -func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - -func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 { - if m != nil && m.AggregatedPayloadSize != nil { - return *m.AggregatedPayloadSize - } - return 0 -} - -// Configuration for a particular response. -type ResponseParameters struct { - // Desired payload sizes in responses from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - Size *int32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"` - // Desired interval between consecutive responses in the response stream in - // microseconds. - IntervalUs *int32 `protobuf:"varint,2,opt,name=interval_us" json:"interval_us,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *ResponseParameters) Reset() { *m = ResponseParameters{} } -func (m *ResponseParameters) String() string { return proto.CompactTextString(m) } -func (*ResponseParameters) ProtoMessage() {} -func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } - -func (m *ResponseParameters) GetSize() int32 { - if m != nil && m.Size != nil { - return *m.Size - } - return 0 -} - -func (m *ResponseParameters) GetIntervalUs() int32 { - if m != nil && m.IntervalUs != nil { - return *m.IntervalUs - } - return 0 -} - -// Server-streaming request. -type StreamingOutputCallRequest struct { - // Desired payload type in the response from the server. - // If response_type is RANDOM, the payload from each response in the stream - // might be of different types. This is to simulate a mixed type of payload - // stream. - ResponseType *PayloadType `protobuf:"varint,1,opt,name=response_type,enum=grpc.testing.PayloadType" json:"response_type,omitempty"` - // Configuration for each expected response message. - ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters" json:"response_parameters,omitempty"` - // Optional input payload sent along with the request. - Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} } -func (m *StreamingOutputCallRequest) String() string { return proto.CompactTextString(m) } -func (*StreamingOutputCallRequest) ProtoMessage() {} -func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } - -func (m *StreamingOutputCallRequest) GetResponseType() PayloadType { - if m != nil && m.ResponseType != nil { - return *m.ResponseType - } - return PayloadType_COMPRESSABLE -} - -func (m *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters { - if m != nil { - return m.ResponseParameters - } - return nil -} - -func (m *StreamingOutputCallRequest) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -// Server-streaming response, as configured by the request and parameters. -type StreamingOutputCallResponse struct { - // Payload to increase response size. - Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} } -func (m *StreamingOutputCallResponse) String() string { return proto.CompactTextString(m) } -func (*StreamingOutputCallResponse) ProtoMessage() {} -func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } - -func (m *StreamingOutputCallResponse) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -func init() { - proto.RegisterType((*Empty)(nil), "grpc.testing.Empty") - proto.RegisterType((*Payload)(nil), "grpc.testing.Payload") - proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") - proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") - proto.RegisterType((*StreamingInputCallRequest)(nil), "grpc.testing.StreamingInputCallRequest") - proto.RegisterType((*StreamingInputCallResponse)(nil), "grpc.testing.StreamingInputCallResponse") - proto.RegisterType((*ResponseParameters)(nil), "grpc.testing.ResponseParameters") - proto.RegisterType((*StreamingOutputCallRequest)(nil), "grpc.testing.StreamingOutputCallRequest") - proto.RegisterType((*StreamingOutputCallResponse)(nil), "grpc.testing.StreamingOutputCallResponse") - proto.RegisterEnum("grpc.testing.PayloadType", PayloadType_name, PayloadType_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// Client API for TestService service - -type TestServiceClient interface { - // One empty request followed by one empty response. - EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) - // One request followed by one response. - // The server returns the client payload as-is. - UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) - // One request followed by a sequence of responses (streamed download). - // The server returns the payload with client desired type and sizes. - StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) - // A sequence of requests followed by one response (streamed upload). - // The server returns the aggregated size of client payload as the result. - StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingInputCallClient, error) - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) - // A sequence of requests followed by a sequence of responses. - // The server buffers all the client requests and then serves them in order. A - // stream of responses are returned to the client when the server starts with - // first request. - HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error) -} - -type testServiceClient struct { - cc *grpc.ClientConn -} - -func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient { - return &testServiceClient{cc} -} - -func (c *testServiceClient) EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := grpc.Invoke(ctx, "/grpc.testing.TestService/EmptyCall", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testServiceClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { - out := new(SimpleResponse) - err := grpc.Invoke(ctx, "/grpc.testing.TestService/UnaryCall", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *testServiceClient) StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error) { - stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[0], c.cc, "/grpc.testing.TestService/StreamingOutputCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceStreamingOutputCallClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type TestService_StreamingOutputCallClient interface { - Recv() (*StreamingOutputCallResponse, error) - grpc.ClientStream -} - -type testServiceStreamingOutputCallClient struct { - grpc.ClientStream -} - -func (x *testServiceStreamingOutputCallClient) Recv() (*StreamingOutputCallResponse, error) { - m := new(StreamingOutputCallResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testServiceClient) StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingInputCallClient, error) { - stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[1], c.cc, "/grpc.testing.TestService/StreamingInputCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceStreamingInputCallClient{stream} - return x, nil -} - -type TestService_StreamingInputCallClient interface { - Send(*StreamingInputCallRequest) error - CloseAndRecv() (*StreamingInputCallResponse, error) - grpc.ClientStream -} - -type testServiceStreamingInputCallClient struct { - grpc.ClientStream -} - -func (x *testServiceStreamingInputCallClient) Send(m *StreamingInputCallRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testServiceStreamingInputCallClient) CloseAndRecv() (*StreamingInputCallResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(StreamingInputCallResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testServiceClient) FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error) { - stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[2], c.cc, "/grpc.testing.TestService/FullDuplexCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceFullDuplexCallClient{stream} - return x, nil -} - -type TestService_FullDuplexCallClient interface { - Send(*StreamingOutputCallRequest) error - Recv() (*StreamingOutputCallResponse, error) - grpc.ClientStream -} - -type testServiceFullDuplexCallClient struct { - grpc.ClientStream -} - -func (x *testServiceFullDuplexCallClient) Send(m *StreamingOutputCallRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testServiceFullDuplexCallClient) Recv() (*StreamingOutputCallResponse, error) { - m := new(StreamingOutputCallResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *testServiceClient) HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error) { - stream, err := grpc.NewClientStream(ctx, &_TestService_serviceDesc.Streams[3], c.cc, "/grpc.testing.TestService/HalfDuplexCall", opts...) - if err != nil { - return nil, err - } - x := &testServiceHalfDuplexCallClient{stream} - return x, nil -} - -type TestService_HalfDuplexCallClient interface { - Send(*StreamingOutputCallRequest) error - Recv() (*StreamingOutputCallResponse, error) - grpc.ClientStream -} - -type testServiceHalfDuplexCallClient struct { - grpc.ClientStream -} - -func (x *testServiceHalfDuplexCallClient) Send(m *StreamingOutputCallRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testServiceHalfDuplexCallClient) Recv() (*StreamingOutputCallResponse, error) { - m := new(StreamingOutputCallResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// Server API for TestService service - -type TestServiceServer interface { - // One empty request followed by one empty response. - EmptyCall(context.Context, *Empty) (*Empty, error) - // One request followed by one response. - // The server returns the client payload as-is. - UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) - // One request followed by a sequence of responses (streamed download). - // The server returns the payload with client desired type and sizes. - StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error - // A sequence of requests followed by one response (streamed upload). - // The server returns the aggregated size of client payload as the result. - StreamingInputCall(TestService_StreamingInputCallServer) error - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - FullDuplexCall(TestService_FullDuplexCallServer) error - // A sequence of requests followed by a sequence of responses. - // The server buffers all the client requests and then serves them in order. A - // stream of responses are returned to the client when the server starts with - // first request. - HalfDuplexCall(TestService_HalfDuplexCallServer) error -} - -func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { - s.RegisterService(&_TestService_serviceDesc, srv) -} - -func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - out, err := srv.(TestServiceServer).EmptyCall(ctx, in) - if err != nil { - return nil, err - } - return out, nil -} - -func _TestService_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { - in := new(SimpleRequest) - if err := dec(in); err != nil { - return nil, err - } - out, err := srv.(TestServiceServer).UnaryCall(ctx, in) - if err != nil { - return nil, err - } - return out, nil -} - -func _TestService_StreamingOutputCall_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(StreamingOutputCallRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(TestServiceServer).StreamingOutputCall(m, &testServiceStreamingOutputCallServer{stream}) -} - -type TestService_StreamingOutputCallServer interface { - Send(*StreamingOutputCallResponse) error - grpc.ServerStream -} - -type testServiceStreamingOutputCallServer struct { - grpc.ServerStream -} - -func (x *testServiceStreamingOutputCallServer) Send(m *StreamingOutputCallResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _TestService_StreamingInputCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServiceServer).StreamingInputCall(&testServiceStreamingInputCallServer{stream}) -} - -type TestService_StreamingInputCallServer interface { - SendAndClose(*StreamingInputCallResponse) error - Recv() (*StreamingInputCallRequest, error) - grpc.ServerStream -} - -type testServiceStreamingInputCallServer struct { - grpc.ServerStream -} - -func (x *testServiceStreamingInputCallServer) SendAndClose(m *StreamingInputCallResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testServiceStreamingInputCallServer) Recv() (*StreamingInputCallRequest, error) { - m := new(StreamingInputCallRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _TestService_FullDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServiceServer).FullDuplexCall(&testServiceFullDuplexCallServer{stream}) -} - -type TestService_FullDuplexCallServer interface { - Send(*StreamingOutputCallResponse) error - Recv() (*StreamingOutputCallRequest, error) - grpc.ServerStream -} - -type testServiceFullDuplexCallServer struct { - grpc.ServerStream -} - -func (x *testServiceFullDuplexCallServer) Send(m *StreamingOutputCallResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testServiceFullDuplexCallServer) Recv() (*StreamingOutputCallRequest, error) { - m := new(StreamingOutputCallRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _TestService_HalfDuplexCall_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServiceServer).HalfDuplexCall(&testServiceHalfDuplexCallServer{stream}) -} - -type TestService_HalfDuplexCallServer interface { - Send(*StreamingOutputCallResponse) error - Recv() (*StreamingOutputCallRequest, error) - grpc.ServerStream -} - -type testServiceHalfDuplexCallServer struct { - grpc.ServerStream -} - -func (x *testServiceHalfDuplexCallServer) Send(m *StreamingOutputCallResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testServiceHalfDuplexCallServer) Recv() (*StreamingOutputCallRequest, error) { - m := new(StreamingOutputCallRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _TestService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "grpc.testing.TestService", - HandlerType: (*TestServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EmptyCall", - Handler: _TestService_EmptyCall_Handler, - }, - { - MethodName: "UnaryCall", - Handler: _TestService_UnaryCall_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamingOutputCall", - Handler: _TestService_StreamingOutputCall_Handler, - ServerStreams: true, - }, - { - StreamName: "StreamingInputCall", - Handler: _TestService_StreamingInputCall_Handler, - ClientStreams: true, - }, - { - StreamName: "FullDuplexCall", - Handler: _TestService_FullDuplexCall_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "HalfDuplexCall", - Handler: _TestService_HalfDuplexCall_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, -} - -var fileDescriptor0 = []byte{ - // 567 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xbc, 0x54, 0x51, 0x6f, 0xd2, 0x50, - 0x14, 0xb6, 0x03, 0x64, 0x1c, 0x58, 0x43, 0x0e, 0x59, 0x64, 0x9d, 0x89, 0x4b, 0x7d, 0xb0, 0x9a, - 0x88, 0x86, 0x44, 0x1f, 0x35, 0x73, 0x63, 0x71, 0x09, 0x03, 0x6c, 0xe1, 0x99, 0x5c, 0xe1, 0x0e, - 0x9b, 0x94, 0xb6, 0xb6, 0xb7, 0x46, 0x7c, 0xf0, 0x8f, 0xf9, 0x67, 0xfc, 0x11, 0xfe, 0x00, 0xef, - 0xbd, 0x6d, 0xa1, 0x40, 0x17, 0x99, 0xc6, 0xbd, 0xb5, 0xdf, 0xf9, 0xce, 0x77, 0xbe, 0xef, 0x9e, - 0xdb, 0x02, 0x30, 0x1a, 0xb2, 0x96, 0x1f, 0x78, 0xcc, 0xc3, 0xda, 0x2c, 0xf0, 0x27, 0x2d, 0x01, - 0xd8, 0xee, 0x4c, 0x2f, 0x43, 0xa9, 0x33, 0xf7, 0xd9, 0x42, 0xef, 0x42, 0x79, 0x40, 0x16, 0x8e, - 0x47, 0xa6, 0xf8, 0x1c, 0x8a, 0x6c, 0xe1, 0xd3, 0xa6, 0x72, 0xa2, 0x18, 0x6a, 0xfb, 0xa8, 0x95, - 0x6d, 0x68, 0x25, 0xa4, 0x21, 0x27, 0x98, 0x92, 0x86, 0x08, 0xc5, 0x8f, 0xde, 0x74, 0xd1, 0xdc, - 0xe3, 0xf4, 0x9a, 0x29, 0x9f, 0xf5, 0x5f, 0x0a, 0x1c, 0x58, 0xf6, 0xdc, 0x77, 0xa8, 0x49, 0x3f, - 0x47, 0xbc, 0x15, 0xdf, 0xc0, 0x41, 0x40, 0x43, 0xdf, 0x73, 0x43, 0x3a, 0xde, 0x4d, 0xbd, 0x96, - 0xf2, 0xc5, 0x1b, 0x3e, 0xce, 0xf4, 0x87, 0xf6, 0x37, 0x2a, 0xc7, 0x95, 0x56, 0x24, 0x8b, 0x63, - 0xf8, 0x02, 0xca, 0x7e, 0xac, 0xd0, 0x2c, 0xf0, 0x72, 0xb5, 0x7d, 0x98, 0x2b, 0x6f, 0xa6, 0x2c, - 0xa1, 0x7a, 0x6d, 0x3b, 0xce, 0x38, 0x0a, 0x69, 0xe0, 0x92, 0x39, 0x6d, 0x16, 0x79, 0xdb, 0xbe, - 0x59, 0x13, 0xe0, 0x28, 0xc1, 0xd0, 0x80, 0xba, 0x24, 0x79, 0x24, 0x62, 0x9f, 0xc6, 0xe1, 0xc4, - 0xe3, 0xee, 0x4b, 0x92, 0xa7, 0x0a, 0xbc, 0x2f, 0x60, 0x4b, 0xa0, 0xfa, 0x77, 0x50, 0xd3, 0xd4, - 0xb1, 0xab, 0xac, 0x23, 0x65, 0x27, 0x47, 0x1a, 0xec, 0x2f, 0xcd, 0x88, 0x88, 0x15, 0x73, 0xf9, - 0x8e, 0x8f, 0xa0, 0x9a, 0xf5, 0x50, 0x90, 0x65, 0xf0, 0x56, 0xf3, 0xbb, 0x70, 0x64, 0xb1, 0x80, - 0x92, 0x39, 0x97, 0xbe, 0x74, 0xfd, 0x88, 0x9d, 0x11, 0xc7, 0x49, 0x37, 0x70, 0x5b, 0x2b, 0xfa, - 0x10, 0xb4, 0x3c, 0xb5, 0x24, 0xd9, 0x6b, 0x78, 0x40, 0x66, 0xb3, 0x80, 0xce, 0x08, 0xa3, 0xd3, - 0x71, 0xd2, 0x13, 0xaf, 0x46, 0x91, 0xab, 0x39, 0x5c, 0x95, 0x13, 0x69, 0xb1, 0x23, 0xfd, 0x12, - 0x30, 0xd5, 0x18, 0x90, 0x80, 0xc7, 0x62, 0x34, 0x08, 0xc5, 0x25, 0xca, 0xb4, 0xca, 0x67, 0x11, - 0xd7, 0x76, 0x79, 0xf5, 0x0b, 0x11, 0x0b, 0x4a, 0x16, 0x0e, 0x29, 0x34, 0x0a, 0xf5, 0x9f, 0x4a, - 0xc6, 0x61, 0x3f, 0x62, 0x1b, 0x81, 0xff, 0xf5, 0xca, 0x7d, 0x80, 0xc6, 0xb2, 0xdf, 0x5f, 0x5a, - 0xe5, 0x3e, 0x0a, 0xfc, 0xf0, 0x4e, 0xd6, 0x55, 0xb6, 0x23, 0x99, 0x18, 0x6c, 0xc7, 0xbc, 0xed, - 0x05, 0xd5, 0x7b, 0x70, 0x9c, 0x9b, 0xf0, 0x2f, 0xaf, 0xd7, 0xb3, 0xb7, 0x50, 0xcd, 0x04, 0xc6, - 0x3a, 0xd4, 0xce, 0xfa, 0x57, 0x03, 0xb3, 0x63, 0x59, 0xa7, 0xef, 0xba, 0x9d, 0xfa, 0x3d, 0xbe, - 0x08, 0x75, 0xd4, 0x5b, 0xc3, 0x14, 0x04, 0xb8, 0x6f, 0x9e, 0xf6, 0xce, 0xfb, 0x57, 0xf5, 0xbd, - 0xf6, 0x8f, 0x22, 0x54, 0x87, 0x5c, 0xdd, 0xe2, 0x4b, 0xb0, 0x27, 0x14, 0x5f, 0x41, 0x45, 0xfe, - 0x40, 0x84, 0x2d, 0x6c, 0xac, 0x4f, 0x97, 0x05, 0x2d, 0x0f, 0xc4, 0x0b, 0xa8, 0x8c, 0x5c, 0x12, - 0xc4, 0x6d, 0xc7, 0xeb, 0x8c, 0xb5, 0x1f, 0x87, 0xf6, 0x30, 0xbf, 0x98, 0x1c, 0x80, 0x03, 0x8d, - 0x9c, 0xf3, 0x41, 0x63, 0xa3, 0xe9, 0xc6, 0x4b, 0xa2, 0x3d, 0xdd, 0x81, 0x19, 0xcf, 0x7a, 0xa9, - 0xa0, 0x0d, 0xb8, 0xfd, 0x45, 0xe0, 0x93, 0x1b, 0x24, 0x36, 0xbf, 0x40, 0xcd, 0xf8, 0x33, 0x31, - 0x1e, 0x65, 0x88, 0x51, 0xea, 0x45, 0xe4, 0x38, 0xe7, 0x11, 0x4f, 0xfb, 0xf5, 0xbf, 0x65, 0x32, - 0x14, 0x99, 0x4a, 0x7d, 0x4f, 0x9c, 0xeb, 0x3b, 0x18, 0xf5, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x4c, - 0x41, 0xfe, 0xb6, 0x89, 0x06, 0x00, 0x00, -} diff --git a/vendor/google.golang.org/grpc/test/grpc_testing/test.proto b/vendor/google.golang.org/grpc/test/grpc_testing/test.proto deleted file mode 100644 index b5bfe053789..00000000000 --- a/vendor/google.golang.org/grpc/test/grpc_testing/test.proto +++ /dev/null @@ -1,140 +0,0 @@ -// An integration test service that covers all the method signature permutations -// of unary/streaming requests/responses. -syntax = "proto2"; - -package grpc.testing; - -message Empty {} - -// The type of payload that should be returned. -enum PayloadType { - // Compressable text format. - COMPRESSABLE = 0; - - // Uncompressable binary format. - UNCOMPRESSABLE = 1; - - // Randomly chosen from all other formats defined in this enum. - RANDOM = 2; -} - -// A block of data, to simply increase gRPC message size. -message Payload { - // The type of data in body. - optional PayloadType type = 1; - // Primary contents of payload. - optional bytes body = 2; -} - -// Unary request. -message SimpleRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, server randomly chooses one from other formats. - optional PayloadType response_type = 1; - - // Desired payload size in the response from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - optional int32 response_size = 2; - - // Optional input payload sent along with the request. - optional Payload payload = 3; - - // Whether SimpleResponse should include username. - optional bool fill_username = 4; - - // Whether SimpleResponse should include OAuth scope. - optional bool fill_oauth_scope = 5; -} - -// Unary response, as configured by the request. -message SimpleResponse { - // Payload to increase message size. - optional Payload payload = 1; - - // The user the request came from, for verifying authentication was - // successful when the client expected it. - optional string username = 2; - - // OAuth scope. - optional string oauth_scope = 3; -} - -// Client-streaming request. -message StreamingInputCallRequest { - // Optional input payload sent along with the request. - optional Payload payload = 1; - - // Not expecting any payload from the response. -} - -// Client-streaming response. -message StreamingInputCallResponse { - // Aggregated size of payloads received from the client. - optional int32 aggregated_payload_size = 1; -} - -// Configuration for a particular response. -message ResponseParameters { - // Desired payload sizes in responses from the server. - // If response_type is COMPRESSABLE, this denotes the size before compression. - optional int32 size = 1; - - // Desired interval between consecutive responses in the response stream in - // microseconds. - optional int32 interval_us = 2; -} - -// Server-streaming request. -message StreamingOutputCallRequest { - // Desired payload type in the response from the server. - // If response_type is RANDOM, the payload from each response in the stream - // might be of different types. This is to simulate a mixed type of payload - // stream. - optional PayloadType response_type = 1; - - // Configuration for each expected response message. - repeated ResponseParameters response_parameters = 2; - - // Optional input payload sent along with the request. - optional Payload payload = 3; -} - -// Server-streaming response, as configured by the request and parameters. -message StreamingOutputCallResponse { - // Payload to increase response size. - optional Payload payload = 1; -} - -// A simple service to test the various types of RPCs and experiment with -// performance with various types of payload. -service TestService { - // One empty request followed by one empty response. - rpc EmptyCall(Empty) returns (Empty); - - // One request followed by one response. - // The server returns the client payload as-is. - rpc UnaryCall(SimpleRequest) returns (SimpleResponse); - - // One request followed by a sequence of responses (streamed download). - // The server returns the payload with client desired type and sizes. - rpc StreamingOutputCall(StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); - - // A sequence of requests followed by one response (streamed upload). - // The server returns the aggregated size of client payload as the result. - rpc StreamingInputCall(stream StreamingInputCallRequest) - returns (StreamingInputCallResponse); - - // A sequence of requests with each request served by the server immediately. - // As one request could lead to multiple responses, this interface - // demonstrates the idea of full duplexing. - rpc FullDuplexCall(stream StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); - - // A sequence of requests followed by a sequence of responses. - // The server buffers all the client requests and then serves them in order. A - // stream of responses are returned to the client when the server starts with - // first request. - rpc HalfDuplexCall(stream StreamingOutputCallRequest) - returns (stream StreamingOutputCallResponse); -} diff --git a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/goauth2/LICENSE b/vendor/gopkg.in/inf.v0/LICENSE similarity index 93% rename from vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/goauth2/LICENSE rename to vendor/gopkg.in/inf.v0/LICENSE index 6765f090b41..87a5cede339 100644 --- a/vendor/github.com/coreos/rkt/Godeps/_workspace/src/github.com/camlistore/camlistore/third_party/code.google.com/p/goauth2/LICENSE +++ b/vendor/gopkg.in/inf.v0/LICENSE @@ -1,4 +1,5 @@ -Copyright (c) 2009 The goauth2 Authors. All rights reserved. +Copyright (c) 2012 Péter Surányi. Portions 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 diff --git a/vendor/speter.net/go/exp/math/dec/inf/dec.go b/vendor/gopkg.in/inf.v0/dec.go similarity index 100% rename from vendor/speter.net/go/exp/math/dec/inf/dec.go rename to vendor/gopkg.in/inf.v0/dec.go diff --git a/vendor/speter.net/go/exp/math/dec/inf/rounder.go b/vendor/gopkg.in/inf.v0/rounder.go similarity index 100% rename from vendor/speter.net/go/exp/math/dec/inf/rounder.go rename to vendor/gopkg.in/inf.v0/rounder.go diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/armon/go-metrics/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/armon/go-metrics/LICENSE deleted file mode 100644 index 106569e542b..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/armon/go-metrics/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Armon Dadgar - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/bigdatadev/goryman/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/bigdatadev/goryman/LICENSE deleted file mode 100644 index 282efc468bf..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/bigdatadev/goryman/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Christopher Gilbert - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/blang/semver/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/blang/semver/LICENSE deleted file mode 100644 index 5ba5c86fcb0..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/blang/semver/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2014 Benedikt Lang - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/bluebreezecf/opentsdb-goclient/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/bluebreezecf/opentsdb-goclient/LICENSE deleted file mode 100644 index 13e82a7d627..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/bluebreezecf/opentsdb-goclient/LICENSE +++ /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. - -END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/boltdb/bolt/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/boltdb/bolt/LICENSE deleted file mode 100644 index 004e77fe5d2..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/github.com/davecgh/go-spew/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/davecgh/go-spew/LICENSE deleted file mode 100644 index 2a7cfd2bf6a..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/davecgh/go-spew/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2012-2013 Dave Collins - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/LICENSE deleted file mode 100644 index c7a3f0cfd45..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://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 2013-2015 Docker, Inc. - - 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 - - https://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/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/NOTICE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/NOTICE deleted file mode 100644 index 6e6f469ab9b..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/NOTICE +++ /dev/null @@ -1,19 +0,0 @@ -Docker -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (https://www.docker.com). - -This product contains software (https://github.com/kr/pty) developed -by Keith Rarick, licensed under the MIT License. - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see https://www.bis.doc.gov - -See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/contrib/syntax/vim/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/contrib/syntax/vim/LICENSE deleted file mode 100644 index e67cdabd22e..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/contrib/syntax/vim/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Honza Pokorny -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/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/docs/project/images/red_notice.png b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/docs/project/images/red_notice.png deleted file mode 100644 index 8839723a376..00000000000 Binary files a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/docs/project/images/red_notice.png and /dev/null differ diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/LICENSE deleted file mode 100644 index ac74d8f0496..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014-2015 The Docker & 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/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.APACHE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.APACHE deleted file mode 100644 index 9e4bd4dbee9..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.APACHE +++ /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 2014-2015 Docker, Inc. - - 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/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD deleted file mode 100644 index ac74d8f0496..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014-2015 The Docker & 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/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/transport/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/transport/LICENSE deleted file mode 100644 index d02f24fd528..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/docker/pkg/transport/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The oauth2 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/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.code b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.code deleted file mode 100644 index b55b37bc316..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.code +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - https://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 Docker, Inc. - - 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 - - https://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/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.docs b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.docs deleted file mode 100644 index e26cd4fc8ed..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/go-units/LICENSE.docs +++ /dev/null @@ -1,425 +0,0 @@ -Attribution-ShareAlike 4.0 International - -======================================================================= - -Creative Commons Corporation ("Creative Commons") is not a law firm and -does not provide legal services or legal advice. Distribution of -Creative Commons public licenses does not create a lawyer-client or -other relationship. Creative Commons makes its licenses and related -information available on an "as-is" basis. Creative Commons gives no -warranties regarding its licenses, any material licensed under their -terms and conditions, or any related information. Creative Commons -disclaims all liability for damages resulting from their use to the -fullest extent possible. - -Using Creative Commons Public Licenses - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. The -following considerations are for informational purposes only, are not -exhaustive, and do not form part of our licenses. - - Considerations for licensors: Our public licenses are - intended for use by those authorized to give the public - permission to use material in ways otherwise restricted by - copyright and certain other rights. Our licenses are - irrevocable. Licensors should read and understand the terms - and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before - applying our licenses so that the public can reuse the - material as expected. Licensors should clearly mark any - material not subject to the license. This includes other CC- - licensed material, or material used under an exception or - limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors - - Considerations for the public: By using one of our public - licenses, a licensor grants the public permission to use the - licensed material under specified terms and conditions. If - the licensor's permission is not necessary for any reason--for - example, because of any applicable exception or limitation to - copyright--then that use is not regulated by the license. Our - licenses grant only permissions under copyright and certain - other rights that a licensor has authority to grant. Use of - the licensed material may still be restricted for other - reasons, including because others have copyright or other - rights in the material. A licensor may make special requests, - such as asking that all changes be marked or described. - Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More_considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees - -======================================================================= - -Creative Commons Attribution-ShareAlike 4.0 International Public -License - -By exercising the Licensed Rights (defined below), You accept and agree -to be bound by the terms and conditions of this Creative Commons -Attribution-ShareAlike 4.0 International Public License ("Public -License"). To the extent this Public License may be interpreted as a -contract, You are granted the Licensed Rights in consideration of Your -acceptance of these terms and conditions, and the Licensor grants You -such rights in consideration of benefits the Licensor receives from -making the Licensed Material available under these terms and -conditions. - - -Section 1 -- Definitions. - - a. Adapted Material means material subject to Copyright and Similar - Rights that is derived from or based upon the Licensed Material - and in which the Licensed Material is translated, altered, - arranged, transformed, or otherwise modified in a manner requiring - permission under the Copyright and Similar Rights held by the - Licensor. For purposes of this Public License, where the Licensed - Material is a musical work, performance, or sound recording, - Adapted Material is always produced where the Licensed Material is - synched in timed relation with a moving image. - - b. Adapter's License means the license You apply to Your Copyright - and Similar Rights in Your contributions to Adapted Material in - accordance with the terms and conditions of this Public License. - - c. BY-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights - closely related to copyright including, without limitation, - performance, broadcast, sound recording, and Sui Generis Database - Rights, without regard to how the rights are labeled or - categorized. For purposes of this Public License, the rights - specified in Section 2(b)(1)-(2) are not Copyright and Similar - Rights. - - e. Effective Technological Measures means those measures that, in the - absence of proper authority, may not be circumvented under laws - fulfilling obligations under Article 11 of the WIPO Copyright - Treaty adopted on December 20, 1996, and/or similar international - agreements. - - f. Exceptions and Limitations means fair use, fair dealing, and/or - any other exception or limitation to Copyright and Similar Rights - that applies to Your use of the Licensed Material. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. Licensed Rights means the rights granted to You subject to the - terms and conditions of this Public License, which are limited to - all Copyright and Similar Rights that apply to Your use of the - Licensed Material and that the Licensor has authority to license. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. Share means to provide material to the public by any means or - process that requires permission under the Licensed Rights, such - as reproduction, public display, public performance, distribution, - dissemination, communication, or importation, and to make material - available to the public including in ways that members of the - public may access the material from a place and at a time - individually chosen by them. - - l. Sui Generis Database Rights means rights other than copyright - resulting from Directive 96/9/EC of the European Parliament and of - the Council of 11 March 1996 on the legal protection of databases, - as amended and/or succeeded, as well as other essentially - equivalent rights anywhere in the world. - - m. You means the individual or entity exercising the Licensed Rights - under this Public License. Your has a corresponding meaning. - - -Section 2 -- Scope. - - a. License grant. - - 1. Subject to the terms and conditions of this Public License, - the Licensor hereby grants You a worldwide, royalty-free, - non-sublicensable, non-exclusive, irrevocable license to - exercise the Licensed Rights in the Licensed Material to: - - a. reproduce and Share the Licensed Material, in whole or - in part; and - - b. produce, reproduce, and Share Adapted Material. - - 2. Exceptions and Limitations. For the avoidance of doubt, where - Exceptions and Limitations apply to Your use, this Public - License does not apply, and You do not need to comply with - its terms and conditions. - - 3. Term. The term of this Public License is specified in Section - 6(a). - - 4. Media and formats; technical modifications allowed. The - Licensor authorizes You to exercise the Licensed Rights in - all media and formats whether now known or hereafter created, - and to make technical modifications necessary to do so. The - Licensor waives and/or agrees not to assert any right or - authority to forbid You from making technical modifications - necessary to exercise the Licensed Rights, including - technical modifications necessary to circumvent Effective - Technological Measures. For purposes of this Public License, - simply making modifications authorized by this Section 2(a) - (4) never produces Adapted Material. - - 5. Downstream recipients. - - a. Offer from the Licensor -- Licensed Material. Every - recipient of the Licensed Material automatically - receives an offer from the Licensor to exercise the - Licensed Rights under the terms and conditions of this - Public License. - - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose - any additional or different terms or conditions on, or - apply any Effective Technological Measures to, the - Licensed Material if doing so restricts exercise of the - Licensed Rights by any recipient of the Licensed - Material. - - 6. No endorsement. Nothing in this Public License constitutes or - may be construed as permission to assert or imply that You - are, or that Your use of the Licensed Material is, connected - with, or sponsored, endorsed, or granted official status by, - the Licensor or others designated to receive attribution as - provided in Section 3(a)(1)(A)(i). - - b. Other rights. - - 1. Moral rights, such as the right of integrity, are not - licensed under this Public License, nor are publicity, - privacy, and/or other similar personality rights; however, to - the extent possible, the Licensor waives and/or agrees not to - assert any such rights held by the Licensor to the limited - extent necessary to allow You to exercise the Licensed - Rights, but not otherwise. - - 2. Patent and trademark rights are not licensed under this - Public License. - - 3. To the extent possible, the Licensor waives any right to - collect royalties from You for the exercise of the Licensed - Rights, whether directly or through a collecting society - under any voluntary or waivable statutory or compulsory - licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties. - - -Section 3 -- License Conditions. - -Your exercise of the Licensed Rights is expressly made subject to the -following conditions. - - a. Attribution. - - 1. If You Share the Licensed Material (including in modified - form), You must: - - a. retain the following if it is supplied by the Licensor - with the Licensed Material: - - i. identification of the creator(s) of the Licensed - Material and any others designated to receive - attribution, in any reasonable manner requested by - the Licensor (including by pseudonym if - designated); - - ii. a copyright notice; - - iii. a notice that refers to this Public License; - - iv. a notice that refers to the disclaimer of - warranties; - - v. a URI or hyperlink to the Licensed Material to the - extent reasonably practicable; - - b. indicate if You modified the Licensed Material and - retain an indication of any previous modifications; and - - c. indicate the Licensed Material is licensed under this - Public License, and include the text of, or the URI or - hyperlink to, this Public License. - - 2. You may satisfy the conditions in Section 3(a)(1) in any - reasonable manner based on the medium, means, and context in - which You Share the Licensed Material. For example, it may be - reasonable to satisfy the conditions by providing a URI or - hyperlink to a resource that includes the required - information. - - 3. If requested by the Licensor, You must remove any of the - information required by Section 3(a)(1)(A) to the extent - reasonably practicable. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -Section 4 -- Sui Generis Database Rights. - -Where the Licensed Rights include Sui Generis Database Rights that -apply to Your use of the Licensed Material: - - a. for the avoidance of doubt, Section 2(a)(1) grants You the right - to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database; - - b. if You include all or a substantial portion of the database - contents in a database in which You have Sui Generis Database - Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - - including for purposes of Section 3(b); and - c. You must comply with the conditions in Section 3(a) if You Share - all or a substantial portion of the contents of the database. - -For the avoidance of doubt, this Section 4 supplements and does not -replace Your obligations under this Public License where the Licensed -Rights include other Copyright and Similar Rights. - - -Section 5 -- Disclaimer of Warranties and Limitation of Liability. - - a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE - EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS - AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF - ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, - IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, - WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, - ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT - KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT - ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. - - b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE - TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, - NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, - INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, - COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR - USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR - DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR - IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. - - c. The disclaimer of warranties and limitation of liability provided - above shall be interpreted in a manner that, to the extent - possible, most closely approximates an absolute disclaimer and - waiver of all liability. - - -Section 6 -- Term and Termination. - - a. This Public License applies for the term of the Copyright and - Similar Rights licensed here. However, if You fail to comply with - this Public License, then Your rights under this Public License - terminate automatically. - - b. Where Your right to use the Licensed Material has terminated under - Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided - it is cured within 30 days of Your discovery of the - violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any - right the Licensor may have to seek remedies for Your violations - of this Public License. - - c. For the avoidance of doubt, the Licensor may also offer the - Licensed Material under separate terms or conditions or stop - distributing the Licensed Material at any time; however, doing so - will not terminate this Public License. - - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public - License. - - -Section 7 -- Other Terms and Conditions. - - a. The Licensor shall not be bound by any additional or different - terms or conditions communicated by You unless expressly agreed. - - b. Any arrangements, understandings, or agreements regarding the - Licensed Material not stated herein are separate from and - independent of the terms and conditions of this Public License. - - -Section 8 -- Interpretation. - - a. For the avoidance of doubt, this Public License does not, and - shall not be interpreted to, reduce, limit, restrict, or impose - conditions on any use of the Licensed Material that could lawfully - be made without permission under this Public License. - - b. To the extent possible, if any provision of this Public License is - deemed unenforceable, it shall be automatically reformed to the - minimum extent necessary to make it enforceable. If the provision - cannot be reformed, it shall be severed from this Public License - without affecting the enforceability of the remaining terms and - conditions. - - c. No term or condition of this Public License will be waived and no - failure to comply consented to unless expressly agreed to by the - Licensor. - - d. Nothing in this Public License constitutes or may be interpreted - as a limitation upon, or waiver of, any privileges and immunities - that apply to the Licensor or You, including from the legal - processes of any jurisdiction or authority. - - -======================================================================= - -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the "Licensor." Except for the limited purpose of indicating -that material is shared under a Creative Commons public license or as -otherwise permitted by the Creative Commons policies published at -creativecommons.org/policies, Creative Commons does not authorize the -use of the trademark "Creative Commons" or any other trademark or logo -of Creative Commons without its prior written consent including, -without limitation, in connection with any unauthorized modifications -to any of its public licenses or any other arrangements, -understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. - -Creative Commons may be contacted at creativecommons.org. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/libcontainer/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/libcontainer/LICENSE deleted file mode 100644 index 27448585ad4..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/libcontainer/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 2014 Docker, Inc. - - 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/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/libcontainer/NOTICE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/libcontainer/NOTICE deleted file mode 100644 index dc9129878c4..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/docker/libcontainer/NOTICE +++ /dev/null @@ -1,16 +0,0 @@ -libcontainer -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (http://www.docker.com). - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see http://www.bis.doc.gov - -See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/emicklei/go-restful/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/emicklei/go-restful/LICENSE deleted file mode 100644 index ece7ec61eff..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/emicklei/go-restful/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012,2013 Ernest Micklei - -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. \ No newline at end of file diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/ghodss/yaml/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/ghodss/yaml/LICENSE deleted file mode 100644 index 7805d36de73..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/ghodss/yaml/LICENSE +++ /dev/null @@ -1,50 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Sam Ghods - -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. - - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/gogo/protobuf/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/gogo/protobuf/LICENSE deleted file mode 100644 index 335e38e19b9..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/glog/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/glog/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/groupcache/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/groupcache/LICENSE deleted file mode 100644 index 37ec93a14fd..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/groupcache/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/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/protobuf/LICENSE deleted file mode 100644 index 1b1b1921efa..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/snappy/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/snappy/LICENSE deleted file mode 100644 index 6050c10f4c8..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/golang/snappy/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 The Snappy-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/k8s.io/heapster/Godeps/_workspace/src/github.com/google/cadvisor/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/google/cadvisor/LICENSE deleted file mode 100644 index 97cec18e875..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/google/cadvisor/LICENSE +++ /dev/null @@ -1,190 +0,0 @@ - Copyright 2014 The cAdvisor 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. - - 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 diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/google/gofuzz/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/google/gofuzz/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/google/gofuzz/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/k8s.io/heapster/Godeps/_workspace/src/github.com/hashicorp/go-msgpack/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hashicorp/go-msgpack/LICENSE deleted file mode 100644 index ccae99f6a9a..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hashicorp/go-msgpack/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2012, 2013 Ugorji Nwoke. -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. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hashicorp/raft-boltdb/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hashicorp/raft-boltdb/LICENSE deleted file mode 100644 index f0e5c79e181..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hashicorp/raft-boltdb/LICENSE +++ /dev/null @@ -1,362 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hashicorp/raft/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hashicorp/raft/LICENSE deleted file mode 100644 index c33dcc7c928..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hashicorp/raft/LICENSE +++ /dev/null @@ -1,354 +0,0 @@ -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. “Contributor” - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. “Contributor Version” - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - - means Covered Software of a particular Contributor. - -1.4. “Covered Software” - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. “Incompatible With Secondary Licenses” - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version - 1.1 or earlier of the License, but not also under the terms of a - Secondary License. - -1.6. “Executable Form” - - means any form of the work other than Source Code Form. - -1.7. “Larger Work” - - means a work that combines Covered Software with other material, in a separate - file or files, that is not Covered Software. - -1.8. “License” - - means this document. - -1.9. “Licensable” - - means having the right to grant, to the maximum extent possible, whether at the - time of the initial grant or subsequently, any and all of the rights conveyed by - this License. - -1.10. “Modifications” - - means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion - from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - - means any patent claim(s), including without limitation, method, process, - and apparatus claims, in any patent Licensable by such Contributor that - would be infringed, but for the grant of the License, by the making, - using, selling, offering for sale, having made, import, or transfer of - either its Contributions or its Contributor Version. - -1.12. “Secondary License” - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - - means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, “control” means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or as - part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its Contributions - or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution become - effective for each Contribution on the date the Contributor first distributes - such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under this - License. No additional rights or licenses will be implied from the distribution - or licensing of Covered Software under this License. Notwithstanding Section - 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its - Contributions. - - This License does not grant any rights in the trademarks, service marks, or - logos of any Contributor (except as may be necessary to comply with the - notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this License - (see Section 10.2) or under the terms of a Secondary License (if permitted - under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its Contributions - are its original creation(s) or it has sufficient rights to grant the - rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under applicable - copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under the - terms of this License. You must inform recipients that the Source Code Form - of the Covered Software is governed by the terms of this License, and how - they can obtain a copy of this License. You may not attempt to alter or - restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, - or sublicense it under different terms, provided that the license for - the Executable Form does not attempt to limit or alter the recipients’ - rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for the - Covered Software. If the Larger Work is a combination of Covered Software - with a work governed by one or more Secondary Licenses, and the Covered - Software is not Incompatible With Secondary Licenses, this License permits - You to additionally distribute such Covered Software under the terms of - such Secondary License(s), so that the recipient of the Larger Work may, at - their option, further distribute the Covered Software under the terms of - either this License or such Secondary License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices (including - copyright notices, patent notices, disclaimers of warranty, or limitations - of liability) contained within the Source Code Form of the Covered - Software, except that You may alter any license notices to the extent - required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on behalf - of any Contributor. You must make it absolutely clear that any such - warranty, support, indemnity, or liability obligation is offered by You - alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, judicial - order, or regulation then You must: (a) comply with the terms of this License - to the maximum extent possible; and (b) describe the limitations and the code - they affect. Such description must be placed in a text file included with all - distributions of the Covered Software under this License. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing basis, - if such Contributor fails to notify You of the non-compliance by some - reasonable means prior to 60 days after You have come back into compliance. - Moreover, Your grants from a particular Contributor are reinstated on an - ongoing basis if such Contributor notifies You of the non-compliance by - some reasonable means, this is the first time You have received notice of - non-compliance with this License from such Contributor, and You become - compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, counter-claims, - and cross-claims) alleging that a Contributor Version directly or - indirectly infringes any patent, then the rights granted to You by any and - all Contributors for the Covered Software under Section 2.1 of this License - shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without - warranty of any kind, either expressed, implied, or statutory, including, - without limitation, warranties that the Covered Software is free of defects, - merchantable, fit for a particular purpose or non-infringing. The entire - risk as to the quality and performance of the Covered Software is with You. - Should any Covered Software prove defective in any respect, You (not any - Contributor) assume the cost of any necessary servicing, repair, or - correction. This disclaimer of warranty constitutes an essential part of this - License. No use of any Covered Software is authorized under this License - except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from such - party’s negligence to the extent applicable law prohibits such limitation. - Some jurisdictions do not allow the exclusion or limitation of incidental or - consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts of - a jurisdiction where the defendant maintains its principal place of business - and such litigation shall be governed by laws of that jurisdiction, without - reference to its conflict-of-law provisions. Nothing in this Section shall - prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject matter - hereof. If any provision of this License is held to be unenforceable, such - provision shall be reformed only to the extent necessary to make it - enforceable. Any law or regulation which provides that the language of a - contract shall be construed against the drafter shall not be used to construe - this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version of - the License under which You originally received the Covered Software, or - under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a modified - version of this License if you rename the license and remove any - references to the name of the license steward (except to note that such - modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then -You may include the notice in a location (such as a LICENSE file in a relevant -directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible - With Secondary Licenses”, as defined by - the Mozilla Public License, v. 2.0. - diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hawkular/hawkular-client-go/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hawkular/hawkular-client-go/LICENSE deleted file mode 100644 index 8f71f43fee3..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/hawkular/hawkular-client-go/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/k8s.io/heapster/Godeps/_workspace/src/github.com/imdario/mergo/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/imdario/mergo/LICENSE deleted file mode 100644 index 686680298da..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/imdario/mergo/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2013 Dario Castañé. 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/k8s.io/heapster/Godeps/_workspace/src/github.com/influxdb/influxdb/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/influxdb/influxdb/LICENSE deleted file mode 100644 index d50222706cf..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/influxdb/influxdb/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2015 Errplane Inc. - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/juju/ratelimit/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/juju/ratelimit/LICENSE deleted file mode 100644 index ade9307b390..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/juju/ratelimit/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -All files in this repository are licensed as follows. If you contribute -to this repository, it is assumed that you license your contribution -under the same license unless you state otherwise. - -All files Copyright (C) 2015 Canonical Ltd. unless otherwise specified in the file. - -This software is licensed under the LGPLv3, included below. - -As a special exception to the GNU Lesser General Public License version 3 -("LGPL3"), the copyright holders of this Library give you permission to -convey to a third party a Combined Work that links statically or dynamically -to this Library without providing any Minimal Corresponding Source or -Minimal Application Code as set out in 4d or providing the installation -information set out in section 4e, provided that you comply with the other -provisions of LGPL3 and provided that you meet, for the Application the -terms and conditions of the license(s) which apply to the Application. - -Except as stated in this special exception, the provisions of LGPL3 will -continue to comply in full to this Library. If you modify this Library, you -may apply this exception to your version of this Library, but you are not -obliged to do so. If you do not wish to do so, delete this exception -statement from your version. This exception does not (and cannot) modify any -license terms which apply to the Application, with which you must still -comply. - - - GNU LESSER 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. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser 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 -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/matttproud/golang_protobuf_extensions/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/matttproud/golang_protobuf_extensions/LICENSE deleted file mode 100644 index 13f15dfce0c..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/matttproud/golang_protobuf_extensions/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 2013 Matt T. Proud - - 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/k8s.io/heapster/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE deleted file mode 100644 index f9c841a51e0..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/mitchellh/mapstructure/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Mitchell Hashimoto - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/opencontainers/runc/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/opencontainers/runc/LICENSE deleted file mode 100644 index 27448585ad4..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/opencontainers/runc/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 2014 Docker, Inc. - - 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/k8s.io/heapster/Godeps/_workspace/src/github.com/opencontainers/runc/NOTICE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/opencontainers/runc/NOTICE deleted file mode 100644 index 5c97abce4b9..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/opencontainers/runc/NOTICE +++ /dev/null @@ -1,17 +0,0 @@ -runc - -Copyright 2012-2015 Docker, Inc. - -This product includes software developed at Docker, Inc. (http://www.docker.com). - -The following is courtesy of our legal counsel: - - -Use and transfer of Docker may be subject to certain restrictions by the -United States and other governments. -It is your responsibility to ensure that your use and/or transfer does not -violate applicable laws. - -For more information, please see http://www.bis.doc.gov - -See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/optiopay/kafka/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/optiopay/kafka/LICENSE deleted file mode 100644 index caa1f3baf91..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/optiopay/kafka/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 Optiopay - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE deleted file mode 100644 index 5dc68268d90..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/pborman/uuid/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009,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/k8s.io/heapster/Godeps/_workspace/src/github.com/pmezard/go-difflib/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/pmezard/go-difflib/LICENSE deleted file mode 100644 index c67dad612a3..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/pmezard/go-difflib/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013, Patrick Mezard -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. - The names of its contributors may not 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. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_golang/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_golang/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_golang/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/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_golang/NOTICE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_golang/NOTICE deleted file mode 100644 index 37e4a7d410e..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_golang/NOTICE +++ /dev/null @@ -1,28 +0,0 @@ -Prometheus instrumentation library for Go applications -Copyright 2012-2015 The Prometheus Authors - -This product includes software developed at -SoundCloud Ltd. (http://soundcloud.com/). - - -The following components are included in this product: - -goautoneg -http://bitbucket.org/ww/goautoneg -Copyright 2011, Open Knowledge Foundation Ltd. -See README.txt for license details. - -perks - a fork of https://github.com/bmizerany/perks -https://github.com/beorn7/perks -Copyright 2013-2015 Blake Mizerany, Björn Rabenstein -See https://github.com/beorn7/perks/blob/master/README.md for license details. - -Go support for Protocol Buffers - Google's data interchange format -http://github.com/golang/protobuf/ -Copyright 2010 The Go Authors -See source code for license details. - -Support for streaming Protocol Buffer messages for the Go language (golang). -https://github.com/matttproud/golang_protobuf_extensions -Copyright 2013 Matt T. Proud -Licensed under the Apache License, Version 2.0 diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_model/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_model/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_model/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/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_model/NOTICE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_model/NOTICE deleted file mode 100644 index 20110e410e5..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_model/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -Data model artifacts for Prometheus. -Copyright 2012-2015 The Prometheus Authors - -This product includes software developed at -SoundCloud Ltd. (http://soundcloud.com/). diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_model/ruby/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_model/ruby/LICENSE deleted file mode 100644 index 11069edd790..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/client_model/ruby/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/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/procfs/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/procfs/LICENSE deleted file mode 100644 index 261eeb9e9f8..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/procfs/NOTICE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/prometheus/procfs/NOTICE deleted file mode 100644 index 53c5e9aa111..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/github.com/rackspace/gophercloud/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/rackspace/gophercloud/LICENSE deleted file mode 100644 index fbbbc9e4cba..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/rackspace/gophercloud/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -Copyright 2012-2013 Rackspace, Inc. - -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. - ------- - - 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 diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/spf13/pflag/LICENSE deleted file mode 100644 index 63ed1cfea1f..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/github.com/stretchr/objx/LICENSE.md b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/stretchr/objx/LICENSE.md deleted file mode 100644 index 2199945813c..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/stretchr/objx/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -objx - by Mat Ryer and Tyler Bunnell - -The MIT License (MIT) - -Copyright (c) 2014 Stretchr, Inc. - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/stretchr/testify/LICENCE.txt b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/stretchr/testify/LICENCE.txt deleted file mode 100644 index a009ba467ce..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/stretchr/testify/LICENCE.txt +++ /dev/null @@ -1,9 +0,0 @@ -Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell - -Please consider promoting this project if you find it useful. - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/stretchr/testify/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/stretchr/testify/LICENSE deleted file mode 100644 index 473b670a7c6..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/stretchr/testify/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell - -Please consider promoting this project if you find it useful. - -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/k8s.io/heapster/Godeps/_workspace/src/github.com/ugorji/go/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/github.com/ugorji/go/LICENSE deleted file mode 100644 index 95a0f0541cd..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/crypto/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/crypto/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/crypto/PATENTS b/vendor/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/crypto/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/net/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/net/LICENSE deleted file mode 100644 index 6a66aea5eaf..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/net/PATENTS b/vendor/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/net/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/k8s.io/heapster/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/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/oauth2/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/oauth2/LICENSE deleted file mode 100644 index d02f24fd528..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/golang.org/x/oauth2/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The oauth2 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/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/api/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/api/LICENSE deleted file mode 100644 index 263aa7a0c12..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/api/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2011 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/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE deleted file mode 100644 index de9c88cb65c..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/api/googleapi/internal/uritemplates/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright (c) 2013 Joshua Tacoma - -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/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/appengine/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/appengine/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/appengine/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/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/cloud/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/cloud/LICENSE deleted file mode 100644 index a4c5efd822f..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/google.golang.org/cloud/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 2014 Google Inc. - - 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/k8s.io/heapster/Godeps/_workspace/src/gopkg.in/v2/yaml/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/gopkg.in/v2/yaml/LICENSE deleted file mode 100644 index a68e67f01b0..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/gopkg.in/v2/yaml/LICENSE +++ /dev/null @@ -1,188 +0,0 @@ - -Copyright (c) 2011-2014 - Canonical Inc. - -This software is licensed under the LGPLv3, included below. - -As a special exception to the GNU Lesser General Public License version 3 -("LGPL3"), the copyright holders of this Library give you permission to -convey to a third party a Combined Work that links statically or dynamically -to this Library without providing any Minimal Corresponding Source or -Minimal Application Code as set out in 4d or providing the installation -information set out in section 4e, provided that you comply with the other -provisions of LGPL3 and provided that you meet, for the Application the -terms and conditions of the license(s) which apply to the Application. - -Except as stated in this special exception, the provisions of LGPL3 will -continue to comply in full to this Library. If you modify this Library, you -may apply this exception to your version of this Library, but you are not -obliged to do so. If you do not wish to do so, delete this exception -statement from your version. This exception does not (and cannot) modify any -license terms which apply to the Application, with which you must still -comply. - - - GNU LESSER 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. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser 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 -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/gopkg.in/v2/yaml/LICENSE.libyaml b/vendor/k8s.io/heapster/Godeps/_workspace/src/gopkg.in/v2/yaml/LICENSE.libyaml deleted file mode 100644 index 8da58fbf6f8..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/gopkg.in/v2/yaml/LICENSE.libyaml +++ /dev/null @@ -1,31 +0,0 @@ -The following files were ported to Go from C files of libyaml, and thus -are still covered by their original copyright and license: - - apic.go - emitterc.go - parserc.go - readerc.go - scannerc.go - writerc.go - yamlh.go - yamlprivateh.go - -Copyright (c) 2006 Kirill Simonov - -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/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/Godeps/LICENSES.md b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/Godeps/LICENSES.md deleted file mode 100644 index 448927f8de5..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/Godeps/LICENSES.md +++ /dev/null @@ -1,110 +0,0 @@ -Dependency Licenses -------------------- - -Package | License -------- | ------- -bitbucket.org/bertimus9/systemstat | MITname -bitbucket.org/ww/goautoneg | spdxBSD3 -github.com/abbot/go-http-auth | Apache-2 -github.com/appc/cni | Apache-2 -github.com/appc/spec | Apache-2 -github.com/armon/go-metrics | MITname -github.com/aws/aws-sdk-go | Apache-2 -github.com/beorn7/perks/quantile | MIT? -github.com/blang/semver | MITname -github.com/boltdb/bolt | MITname -github.com/camlistore/go4 | Apache-2 -github.com/ClusterHQ/flocker-go | UNKNOWN -github.com/codegangsta/negroni | MITname -github.com/coreos/etcd | Apache-2 -github.com/coreos/go-etcd | Apache-2 -github.com/coreos/go-oidc | Apache-2 -github.com/coreos/go-semver | Apache-2 -github.com/coreos/go-systemd | Apache-2 -github.com/coreos/pkg | Apache-2 -github.com/coreos/rkt | MITname -github.com/cpuguy83/go-md2man | MITname -github.com/davecgh/go-spew | MIToldwithoutSellandNoDocumentationRequi -github.com/daviddengcn/go-colortext | BSD? -github.com/dgrijalva/jwt-go | spdxMIT -github.com/docker/docker | Apache-2 -github.com/docker/docker/pkg/symlink | spdxBSD3 -github.com/docker/go-units | Apache-2 -github.com/docker/spdystream | SeeFile -github.com/elazarl/go-bindata-assetfs | spdxBSD2 -github.com/elazarl/goproxy | BSDWarr -github.com/emicklei/go-restful | MITname -github.com/evanphx/json-patch | BSDWarr -github.com/fsouza/go-dockerclient | spdxBSD2 -github.com/garyburd/redigo/internal | ApachesPermLim -github.com/garyburd/redigo/redis | ApachesPermLim -github.com/ghodss/yaml | MITname -github.com/go-ini/ini | Apache-2 -github.com/godbus/dbus | spdxBSD2 -github.com/gogo/protobuf | spdxBSD3 -github.com/golang/glog | Apache-2 -github.com/golang/groupcache | Apache-2 -github.com/golang/protobuf | spdxBSD3 -github.com/google/btree | Apache-2 -github.com/google/cadvisor | Apache-2 -github.com/google/gofuzz | Apache-2 -github.com/gorilla/context | spdxBSD3 -github.com/gorilla/mux | spdxBSD3 -github.com/hashicorp/go-msgpack | spdxBSD3 -github.com/hashicorp/raft | IntelPart08 -github.com/hashicorp/raft-boltdb | IntelPart08 -github.com/imdario/mergo | spdxBSD3 -github.com/inconshreveable/mousetrap | Apache-2 -github.com/influxdb/influxdb | MITname -github.com/jmespath/go-jmespath | Apache-2 -github.com/jonboulle/clockwork | Apache-2 -github.com/juju/ratelimit | LesserExceptionGPLVer3-TOOLONG -github.com/kardianos/osext | spdxBSD3 -github.com/kr/pty | spdxMIT -github.com/matttproud/golang_protobuf_extensions | Apache-2 -github.com/mesos/mesos-go | Apache-2 -github.com/miekg/dns | spdxBSD3 -github.com/mistifyio/go-zfs | Apache-2 -github.com/mitchellh/mapstructure | MITname -github.com/mvdan/xurls | spdxBSD3 -github.com/mxk/go-flowrate | spdxBSD3 -github.com/onsi/ginkgo | spdxMIT -github.com/onsi/gomega | spdxMIT -github.com/opencontainers/runc | Apache-2 -github.com/pborman/uuid | spdxBSD3 -github.com/pmezard/go-difflib | BSD3 -github.com/prometheus/client_golang | Apache-2 -github.com/prometheus/client_model | Apache-2 -github.com/prometheus/common/expfmt | Apache-2 -github.com/prometheus/common/model | Apache-2 -github.com/prometheus/procfs | Apache-2 -github.com/rackspace/gophercloud | Apache-2 -github.com/russross/blackfriday | AsIsVariant2-TOOLONG -github.com/samuel/go-zookeeper | spdxBSD3 -github.com/scalingdata/gcfg | spdxBSD2 -github.com/seccomp/libseccomp-golang | AllRights-TOOLONG -github.com/shurcooL/sanitized_anchor_name | MIT? -github.com/Sirupsen/logrus | MITname -github.com/skynetservices/skydns | MITname -github.com/spf13/cobra | Apache-2 -github.com/spf13/pflag | spdxBSD3 -github.com/stretchr/objx | MIT? -github.com/stretchr/testify | spdxMIT -github.com/syndtr/gocapability | spdxBSD2 -github.com/ugorji/go | MITname -github.com/vishvananda/netlink | Apache-2 -github.com/xiang90/probing | MITname -github.com/xyproto/simpleredis | MITname -golang.org/x/crypto | spdxBSD3 -golang.org/x/exp | spdxBSD3 -golang.org/x/net | spdxBSD3 -golang.org/x/oauth2 | spdxBSD3 -golang.org/x/sys | spdxBSD3 -golang.org/x/tools | spdxBSD3 -google.golang.org/api | spdxBSD3 -google.golang.org/cloud | Apache-2 -google.golang.org/grpc | spdxBSD3 -gopkg.in/natefinch/lumberjack.v2 | MITname -gopkg.in/yaml.v2 | LesserExceptionGPLVer3-TOOLONG -k8s.io/heapster | Apache-2 -speter.net/go/exp/math/dec/inf | spdxBSD2 diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/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/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/cluster/juju/charms/trusty/kubernetes-master/copyright b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/cluster/juju/charms/trusty/kubernetes-master/copyright deleted file mode 100644 index a0b409a8e84..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/cluster/juju/charms/trusty/kubernetes-master/copyright +++ /dev/null @@ -1,13 +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. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/cluster/juju/charms/trusty/kubernetes/copyright b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/cluster/juju/charms/trusty/kubernetes/copyright deleted file mode 100644 index a0b409a8e84..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/cluster/juju/charms/trusty/kubernetes/copyright +++ /dev/null @@ -1,13 +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. diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/update-demo/local/LICENSE.angular b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/update-demo/local/LICENSE.angular deleted file mode 100644 index 020f87acd2e..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/docs/user-guide/update-demo/local/LICENSE.angular +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2010-2014 Google, Inc. http://angularjs.org - -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/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/typed/generated/extensions/v1beta1/thirdpartyresource.go b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/typed/generated/extensions/v1beta1/thirdpartyresource.go deleted file mode 100644 index cfd128dc3c7..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/typed/generated/extensions/v1beta1/thirdpartyresource.go +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors 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 v1beta1 - -import ( - api "k8s.io/kubernetes/pkg/api" - v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" - watch "k8s.io/kubernetes/pkg/watch" -) - -// ThirdPartyResourcesGetter has a method to return a ThirdPartyResourceInterface. -// A group's client should implement this interface. -type ThirdPartyResourcesGetter interface { - ThirdPartyResources(namespace string) ThirdPartyResourceInterface -} - -// ThirdPartyResourceInterface has methods to work with ThirdPartyResource resources. -type ThirdPartyResourceInterface interface { - Create(*v1beta1.ThirdPartyResource) (*v1beta1.ThirdPartyResource, error) - Update(*v1beta1.ThirdPartyResource) (*v1beta1.ThirdPartyResource, error) - Delete(name string, options *api.DeleteOptions) error - DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error - Get(name string) (*v1beta1.ThirdPartyResource, error) - List(opts api.ListOptions) (*v1beta1.ThirdPartyResourceList, error) - Watch(opts api.ListOptions) (watch.Interface, error) - ThirdPartyResourceExpansion -} - -// thirdPartyResources implements ThirdPartyResourceInterface -type thirdPartyResources struct { - client *ExtensionsClient - ns string -} - -// newThirdPartyResources returns a ThirdPartyResources -func newThirdPartyResources(c *ExtensionsClient, namespace string) *thirdPartyResources { - return &thirdPartyResources{ - client: c, - ns: namespace, - } -} - -// Create takes the representation of a thirdPartyResource and creates it. Returns the server's representation of the thirdPartyResource, and an error, if there is any. -func (c *thirdPartyResources) Create(thirdPartyResource *v1beta1.ThirdPartyResource) (result *v1beta1.ThirdPartyResource, err error) { - result = &v1beta1.ThirdPartyResource{} - err = c.client.Post(). - Namespace(c.ns). - Resource("thirdpartyresources"). - Body(thirdPartyResource). - Do(). - Into(result) - return -} - -// Update takes the representation of a thirdPartyResource and updates it. Returns the server's representation of the thirdPartyResource, and an error, if there is any. -func (c *thirdPartyResources) Update(thirdPartyResource *v1beta1.ThirdPartyResource) (result *v1beta1.ThirdPartyResource, err error) { - result = &v1beta1.ThirdPartyResource{} - err = c.client.Put(). - Namespace(c.ns). - Resource("thirdpartyresources"). - Name(thirdPartyResource.Name). - Body(thirdPartyResource). - Do(). - Into(result) - return -} - -// Delete takes name of the thirdPartyResource and deletes it. Returns an error if one occurs. -func (c *thirdPartyResources) Delete(name string, options *api.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("thirdpartyresources"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *thirdPartyResources) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("thirdpartyresources"). - VersionedParams(&listOptions, api.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Get takes name of the thirdPartyResource, and returns the corresponding thirdPartyResource object, and an error if there is any. -func (c *thirdPartyResources) Get(name string) (result *v1beta1.ThirdPartyResource, err error) { - result = &v1beta1.ThirdPartyResource{} - err = c.client.Get(). - Namespace(c.ns). - Resource("thirdpartyresources"). - Name(name). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ThirdPartyResources that match those selectors. -func (c *thirdPartyResources) List(opts api.ListOptions) (result *v1beta1.ThirdPartyResourceList, err error) { - result = &v1beta1.ThirdPartyResourceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("thirdpartyresources"). - VersionedParams(&opts, api.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested thirdPartyResources. -func (c *thirdPartyResources) Watch(opts api.ListOptions) (watch.Interface, error) { - return c.client.Get(). - Prefix("watch"). - Namespace(c.ns). - Resource("thirdpartyresources"). - VersionedParams(&opts, api.ParameterCodec). - Watch() -} diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/unversioned/thirdpartyresources.go b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/unversioned/thirdpartyresources.go deleted file mode 100644 index 09bc4e4afc8..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/unversioned/thirdpartyresources.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors 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 unversioned - -import ( - "k8s.io/kubernetes/pkg/api" - "k8s.io/kubernetes/pkg/apis/extensions" - "k8s.io/kubernetes/pkg/watch" -) - -// ThirdPartyResourceNamespacer has methods to work with ThirdPartyResource resources in a namespace -type ThirdPartyResourceNamespacer interface { - ThirdPartyResources(namespace string) ThirdPartyResourceInterface -} - -type ThirdPartyResourceInterface interface { - List(opts api.ListOptions) (*extensions.ThirdPartyResourceList, error) - Get(name string) (*extensions.ThirdPartyResource, error) - Create(ctrl *extensions.ThirdPartyResource) (*extensions.ThirdPartyResource, error) - Update(ctrl *extensions.ThirdPartyResource) (*extensions.ThirdPartyResource, error) - UpdateStatus(ctrl *extensions.ThirdPartyResource) (*extensions.ThirdPartyResource, error) - Delete(name string) error - Watch(opts api.ListOptions) (watch.Interface, error) -} - -// thirdPartyResources implements DaemonsSetsNamespacer interface -type thirdPartyResources struct { - r *ExtensionsClient - ns string -} - -func newThirdPartyResources(c *ExtensionsClient, namespace string) *thirdPartyResources { - return &thirdPartyResources{c, namespace} -} - -// Ensure statically that thirdPartyResources implements ThirdPartyResourcesInterface. -var _ ThirdPartyResourceInterface = &thirdPartyResources{} - -func (c *thirdPartyResources) List(opts api.ListOptions) (result *extensions.ThirdPartyResourceList, err error) { - result = &extensions.ThirdPartyResourceList{} - err = c.r.Get().Namespace(c.ns).Resource("thirdpartyresources").VersionedParams(&opts, api.ParameterCodec).Do().Into(result) - return -} - -// Get returns information about a particular third party resource. -func (c *thirdPartyResources) Get(name string) (result *extensions.ThirdPartyResource, err error) { - result = &extensions.ThirdPartyResource{} - err = c.r.Get().Namespace(c.ns).Resource("thirdpartyresources").Name(name).Do().Into(result) - return -} - -// Create creates a new third party resource. -func (c *thirdPartyResources) Create(resource *extensions.ThirdPartyResource) (result *extensions.ThirdPartyResource, err error) { - result = &extensions.ThirdPartyResource{} - err = c.r.Post().Namespace(c.ns).Resource("thirdpartyresources").Body(resource).Do().Into(result) - return -} - -// Update updates an existing third party resource. -func (c *thirdPartyResources) Update(resource *extensions.ThirdPartyResource) (result *extensions.ThirdPartyResource, err error) { - result = &extensions.ThirdPartyResource{} - err = c.r.Put().Namespace(c.ns).Resource("thirdpartyresources").Name(resource.Name).Body(resource).Do().Into(result) - return -} - -// UpdateStatus updates an existing third party resource status -func (c *thirdPartyResources) UpdateStatus(resource *extensions.ThirdPartyResource) (result *extensions.ThirdPartyResource, err error) { - result = &extensions.ThirdPartyResource{} - err = c.r.Put().Namespace(c.ns).Resource("thirdpartyresources").Name(resource.Name).SubResource("status").Body(resource).Do().Into(result) - return -} - -// Delete deletes an existing third party resource. -func (c *thirdPartyResources) Delete(name string) error { - return c.r.Delete().Namespace(c.ns).Resource("thirdpartyresources").Name(name).Do().Error() -} - -// Watch returns a watch.Interface that watches the requested third party resources. -func (c *thirdPartyResources) Watch(opts api.ListOptions) (watch.Interface, error) { - return c.r.Get(). - Prefix("watch"). - Namespace(c.ns). - Resource("thirdpartyresources"). - VersionedParams(&opts, api.ParameterCodec). - Watch() -} diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/pkg/master/thirdparty_controller.go b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/pkg/master/thirdparty_controller.go deleted file mode 100644 index 15b44dfc452..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/pkg/master/thirdparty_controller.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors 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 master - -import ( - "fmt" - "strings" - - "k8s.io/kubernetes/pkg/api" - expapi "k8s.io/kubernetes/pkg/apis/extensions" - thirdpartyresourceetcd "k8s.io/kubernetes/pkg/registry/thirdpartyresource/etcd" - "k8s.io/kubernetes/pkg/registry/thirdpartyresourcedata" - "k8s.io/kubernetes/pkg/runtime" - "k8s.io/kubernetes/pkg/util/sets" -) - -const thirdpartyprefix = "/apis" - -func makeThirdPartyPath(group string) string { - if len(group) == 0 { - return thirdpartyprefix - } - return thirdpartyprefix + "/" + group -} - -func getThirdPartyGroupName(path string) string { - return strings.TrimPrefix(strings.TrimPrefix(path, thirdpartyprefix), "/") -} - -// resourceInterface is the interface for the parts of the master that know how to add/remove -// third party resources. Extracted into an interface for injection for testing. -type resourceInterface interface { - // Remove a third party resource based on the RESTful path for that resource - RemoveThirdPartyResource(path string) error - // Install a third party resource described by 'rsrc' - InstallThirdPartyResource(rsrc *expapi.ThirdPartyResource) error - // Is a particular third party resource currently installed? - HasThirdPartyResource(rsrc *expapi.ThirdPartyResource) (bool, error) - // List all currently installed third party resources - ListThirdPartyResources() []string -} - -// ThirdPartyController is a control loop that knows how to synchronize ThirdPartyResource objects with -// RESTful resources which are present in the API server. -type ThirdPartyController struct { - master resourceInterface - thirdPartyResourceRegistry *thirdpartyresourceetcd.REST -} - -// Synchronize a single resource with RESTful resources on the master -func (t *ThirdPartyController) SyncOneResource(rsrc *expapi.ThirdPartyResource) error { - // TODO: we also need to test if the existing installed resource matches the resource we are sync-ing. - // Currently, if there is an older, incompatible resource installed, we won't remove it. We should detect - // older, incompatible resources and remove them before testing if the resource exists. - hasResource, err := t.master.HasThirdPartyResource(rsrc) - if err != nil { - return err - } - if !hasResource { - return t.master.InstallThirdPartyResource(rsrc) - } - return nil -} - -// Synchronize all resources with RESTful resources on the master -func (t *ThirdPartyController) SyncResources() error { - list, err := t.thirdPartyResourceRegistry.List(api.NewDefaultContext(), nil) - if err != nil { - return err - } - return t.syncResourceList(list) -} - -func (t *ThirdPartyController) syncResourceList(list runtime.Object) error { - existing := sets.String{} - switch list := list.(type) { - case *expapi.ThirdPartyResourceList: - // Loop across all schema objects for third party resources - for ix := range list.Items { - item := &list.Items[ix] - // extract the api group and resource kind from the schema - _, group, err := thirdpartyresourcedata.ExtractApiGroupAndKind(item) - if err != nil { - return err - } - // place it in the set of resources that we expect, so that we don't delete it in the delete pass - existing.Insert(makeThirdPartyPath(group)) - // ensure a RESTful resource for this schema exists on the master - if err := t.SyncOneResource(item); err != nil { - return err - } - } - default: - return fmt.Errorf("expected a *ThirdPartyResourceList, got %#v", list) - } - // deletion phase, get all installed RESTful resources - installed := t.master.ListThirdPartyResources() - for _, installedAPI := range installed { - found := false - // search across the expected restful resources to see if this resource belongs to one of the expected ones - for _, apiPath := range existing.List() { - if installedAPI == apiPath || strings.HasPrefix(installedAPI, apiPath+"/") { - found = true - break - } - } - // not expected, delete the resource - if !found { - if err := t.master.RemoveThirdPartyResource(installedAPI); err != nil { - return err - } - } - } - - return nil -} diff --git a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/forked/reflect/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/forked/reflect/LICENSE deleted file mode 100644 index 74487567632..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/forked/reflect/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/LICENSE deleted file mode 100644 index 74487567632..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -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/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/PATENTS b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/PATENTS deleted file mode 100644 index 733099041f8..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/golang/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/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/htpasswd/COPYING b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/htpasswd/COPYING deleted file mode 100644 index c6b097c0168..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/htpasswd/COPYING +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (C) 2003-2013 Edgewall Software -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/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/intemp/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/intemp/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/intemp/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/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/pause/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/pause/LICENSE deleted file mode 100644 index 2b5e5ff1ab5..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/pause/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -The Expat/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/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/swagger-ui/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/swagger-ui/LICENSE deleted file mode 100644 index 9f93e067e8e..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/k8s.io/kubernetes/third_party/swagger-ui/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -Copyright 2014 Reverb Technologies, Inc. - -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 [apache.org/licenses/LICENSE-2.0](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/k8s.io/heapster/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf/LICENSE b/vendor/k8s.io/heapster/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf/LICENSE deleted file mode 100644 index efa1aa1896a..00000000000 --- a/vendor/k8s.io/heapster/Godeps/_workspace/src/speter.net/go/exp/math/dec/inf/LICENSE +++ /dev/null @@ -1,57 +0,0 @@ -Copyright (c) 2012 Péter Surányi. 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. - -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. - ----------------------------------------------------------------------- -Portions of inf.Dec's source code have been derived from Go and are -covered by the following license: ----------------------------------------------------------------------- - -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/speter.net/go/exp/math/dec/inf/LICENSE b/vendor/speter.net/go/exp/math/dec/inf/LICENSE deleted file mode 100644 index efa1aa1896a..00000000000 --- a/vendor/speter.net/go/exp/math/dec/inf/LICENSE +++ /dev/null @@ -1,57 +0,0 @@ -Copyright (c) 2012 Péter Surányi. 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. - -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. - ----------------------------------------------------------------------- -Portions of inf.Dec's source code have been derived from Go and are -covered by the following license: ----------------------------------------------------------------------- - -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.